Package test_suite :: Package unit_tests :: Package _lib :: Module test_selection
[hide private]
[frames] | no frames]

Source Code for Module test_suite.unit_tests._lib.test_selection

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2007-2013 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  6  #                                                                             # 
  7  # This program is free software: you can redistribute it and/or modify        # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation, either version 3 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # This program is distributed in the hope that it will be useful,             # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 19  #                                                                             # 
 20  ############################################################################### 
 21   
 22  # relax module imports. 
 23  from lib.selection import Selection, parse_token, tokenise 
 24  from lib.errors import RelaxError 
 25  from test_suite.unit_tests.base_classes import UnitTestCase 
 26   
 27   
28 -class Test_selection(UnitTestCase):
29 """Unit tests for the functions of the 'lib.selection' module.""" 30
32 """Test the Selection object for boolean '&' mol-res-spin selections.""" 33 34 # The Selection object. 35 obj = Selection("#Ap4Aase:4 & :Pro@Ca") 36 37 # Test the highest level object. 38 self.assertEqual(obj._union, None) 39 self.assertNotEqual(obj._intersect, None) 40 self.assertEqual(obj.molecules, []) 41 self.assertEqual(obj.residues, []) 42 self.assertEqual(obj.spins, []) 43 44 # Test the first intersection. 45 self.assertEqual(obj._intersect[0]._union, None) 46 self.assertEqual(obj._intersect[0]._intersect, None) 47 self.assertEqual(obj._intersect[0].molecules, ['Ap4Aase']) 48 self.assertEqual(obj._intersect[0].residues, [4]) 49 self.assertEqual(obj._intersect[0].spins, []) 50 51 # Test the second intersection. 52 self.assertEqual(obj._intersect[1]._union, None) 53 self.assertEqual(obj._intersect[1]._intersect, None) 54 self.assertEqual(obj._intersect[1].molecules, []) 55 self.assertEqual(obj._intersect[1].residues, ['Pro']) 56 self.assertEqual(obj._intersect[1].spins, ['Ca'])
57 58
60 """Test the Selection object for boolean '|' mol-res-spin selections.""" 61 62 # The Selection object. 63 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 64 65 # Test the highest level object. 66 self.assertNotEqual(obj._union, None) 67 self.assertEqual(obj._intersect, None) 68 self.assertEqual(obj.molecules, []) 69 self.assertEqual(obj.residues, []) 70 self.assertEqual(obj.spins, []) 71 72 # Test the 1st union. 73 self.assertEqual(obj._union[0]._union, None) 74 self.assertEqual(obj._union[0]._intersect, None) 75 self.assertEqual(obj._union[0].molecules, ['Ap4Aase']) 76 self.assertEqual(obj._union[0].residues, ['Glu']) 77 self.assertEqual(obj._union[0].spins, []) 78 79 # Test the 2nd union. 80 self.assertEqual(obj._union[1]._union, None) 81 self.assertEqual(obj._union[1]._intersect, None) 82 self.assertEqual(obj._union[1].molecules, ['RNA']) 83 self.assertEqual(obj._union[1].residues, []) 84 self.assertEqual(obj._union[1].spins, ['C8'])
85 86
88 """Test the Selection object for complex boolean mol-res-spin selections.""" 89 90 # The Selection object. 91 obj = Selection("#Ap4Aase:4 & :Pro | #RNA") 92 93 # Test the highest level object. 94 self.assertNotEqual(obj._union, None) 95 self.assertEqual(obj._intersect, None) 96 self.assertEqual(obj.molecules, []) 97 self.assertEqual(obj.residues, []) 98 self.assertEqual(obj.spins, []) 99 100 # Test the 1st union (this should be an intersection). 101 self.assertEqual(obj._union[0]._union, None) 102 self.assertNotEqual(obj._union[0]._intersect, None) 103 self.assertEqual(obj._union[0].molecules, []) 104 self.assertEqual(obj._union[0].residues, []) 105 self.assertEqual(obj._union[0].spins, []) 106 107 # Test the 2nd union. 108 self.assertEqual(obj._union[1]._union, None) 109 self.assertEqual(obj._union[1]._intersect, None) 110 self.assertEqual(obj._union[1].molecules, ['RNA']) 111 self.assertEqual(obj._union[1].residues, []) 112 self.assertEqual(obj._union[1].spins, []) 113 114 # Test the 1st union, 1st intersection. 115 self.assertEqual(obj._union[0]._intersect[0]._union, None) 116 self.assertEqual(obj._union[0]._intersect[0]._intersect, None) 117 self.assertEqual(obj._union[0]._intersect[0].molecules, ['Ap4Aase']) 118 self.assertEqual(obj._union[0]._intersect[0].residues, [4]) 119 self.assertEqual(obj._union[0]._intersect[0].spins, []) 120 121 # Test the 1st union, 2nd intersection. 122 self.assertEqual(obj._union[0]._intersect[1]._union, None) 123 self.assertEqual(obj._union[0]._intersect[1]._intersect, None) 124 self.assertEqual(obj._union[0]._intersect[1].molecules, []) 125 self.assertEqual(obj._union[0]._intersect[1].residues, ['Pro']) 126 self.assertEqual(obj._union[0]._intersect[1].spins, [])
127 128
130 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the molecule 'RNA'.""" 131 132 # The Selection object. 133 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 134 135 # Check if the molecule is in the selection. 136 self.assert_(obj.contains_mol('RNA'))
137 138
140 """The Selection object "#Ap4Aase:Glu & #RNA@C8" does not contain the molecule 'RNA'.""" 141 142 # The Selection object. 143 obj = Selection("#Ap4Aase:Glu & #RNA@C8") 144 145 # Check if the molecule is in the selection. 146 self.assert_(not obj.contains_mol('RNA'))
147 148
150 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the molecule 'XXX'.""" 151 152 # The Selection object. 153 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 154 155 # Check if the molecule is in the selection. 156 self.assert_(not obj.contains_mol('XXX'))
157 158
160 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the molecule None.""" 161 162 # The Selection object. 163 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 164 165 # Check if the molecule is in the selection. 166 self.assert_(not obj.contains_mol())
167 168
170 """The Selection object ":Glu" does contain the molecule None.""" 171 172 # The Selection object. 173 obj = Selection(":Glu") 174 175 # Check if the molecule is in the selection. 176 self.assert_(obj.contains_mol())
177 178
180 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the molecule 'R*'.""" 181 182 # The Selection object. 183 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 184 185 # Check if the molecule is in the selection. 186 self.assert_(obj.contains_mol('R*'))
187 188
190 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the molecule '*R*'.""" 191 192 # The Selection object. 193 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 194 195 # Check if the molecule is in the selection. 196 self.assert_(obj.contains_mol('*R*'))
197 198
200 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the res 'Glu' (without the mol name).""" 201 202 # The Selection object. 203 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 204 205 # Check if the molecule is in the selection. 206 self.assert_(not obj.contains_res(res_name='Glu'))
207 208
210 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the res 'Glu' of the mol 'Ap4Aase'.""" 211 212 # The Selection object. 213 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 214 215 # Check if the molecule is in the selection. 216 self.assert_(obj.contains_res(res_name='Glu', mol='Ap4Aase'))
217 218
220 """The Selection object "#Ap4Aase:Glu & #RNA@C8" does not contain the res 'Glu'.""" 221 222 # The Selection object. 223 obj = Selection("#Ap4Aase:Glu & #RNA@C8") 224 225 # Check if the molecule is in the selection. 226 self.assert_(not obj.contains_res(res_name='Glu'))
227 228
230 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the res 'Ala'.""" 231 232 # The Selection object. 233 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 234 235 # Check if the molecule is in the selection. 236 self.assert_(not obj.contains_res(res_name='Ala'))
237 238
240 """The Selection object "#Ap4Aase:Glu | #RNA:14@C8" does not contain the res None.""" 241 242 # The Selection object. 243 obj = Selection("#Ap4Aase:Glu | #RNA:14@C8") 244 245 # Check if the molecule is in the selection. 246 self.assert_(not obj.contains_res())
247 248
250 """The Selection object "#Ap4Aase" does contains the res None.""" 251 252 # The Selection object. 253 obj = Selection("#Ap4Aase") 254 255 # Check if the molecule is in the selection. 256 self.assert_(obj.contains_res(mol='Ap4Aase'))
257 258
260 """The Selection object "#Ap4Aase" does not contain the res None of the mol 'RNA'.""" 261 262 # The Selection object. 263 obj = Selection("#Ap4Aase") 264 265 # Check if the molecule is in the selection. 266 self.assert_(not obj.contains_res(mol='RNA'))
267 268
270 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the res 'G*' of the mol 'Ap4Aase'.""" 271 272 # The Selection object. 273 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 274 275 # Check if the molecule is in the selection. 276 self.assert_(obj.contains_res(res_name='G*', mol='Ap4Aase'))
277 278
280 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the res '*G*' of the mol 'Ap4Aase'.""" 281 282 # The Selection object. 283 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 284 285 # Check if the molecule is in the selection. 286 self.assert_(obj.contains_res(res_name='*G*', mol='Ap4Aase'))
287 288
290 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the spin 'C8' (without the mol name).""" 291 292 # The Selection object. 293 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 294 295 # Check if the molecule is in the selection. 296 self.assert_(not obj.contains_spin(spin_name='C8'))
297 298
300 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the spin 'C8' of the mol 'RNA'.""" 301 302 # The Selection object. 303 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 304 305 # Check if the molecule is in the selection. 306 self.assert_(obj.contains_spin(spin_name='C8', mol='RNA'))
307 308
310 """The Selection object "#Ap4Aase:Glu & #RNA@C8" does not contain the spin 'C8'.""" 311 312 # The Selection object. 313 obj = Selection("#Ap4Aase:Glu & #RNA@C8") 314 315 # Check if the molecule is in the selection. 316 self.assert_(not obj.contains_spin(spin_name='C8'))
317 318
320 """The Selection object "#Ap4Aase:Glu | #RNA@C8" does not contain the spin 'N3'.""" 321 322 # The Selection object. 323 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 324 325 # Check if the molecule is in the selection. 326 self.assert_(not obj.contains_spin(spin_name='N3'))
327 328
330 """The Selection object "#Ap4Aase:Glu | #RNA:14@C8" does not contain the spin None.""" 331 332 # The Selection object. 333 obj = Selection("#Ap4Aase:Glu | #RNA:14@C8") 334 335 # Check if the molecule is in the selection. 336 self.assert_(not obj.contains_spin())
337 338
340 """The Selection object "#Ap4Aase" does contains the spin None.""" 341 342 # The Selection object. 343 obj = Selection("#Ap4Aase") 344 345 # Check if the molecule is in the selection. 346 self.assert_(obj.contains_spin(mol='Ap4Aase'))
347 348
350 """The Selection object "#Ap4Aase" does not contain the spin None of the mol 'RNA'.""" 351 352 # The Selection object. 353 obj = Selection("#Ap4Aase") 354 355 # Check if the molecule is in the selection. 356 self.assert_(not obj.contains_spin(mol='RNA'))
357 358
360 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the spin 'C*' of the mol 'RNA'.""" 361 362 # The Selection object. 363 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 364 365 # Check if the molecule is in the selection. 366 self.assert_(obj.contains_spin(spin_name='C*', mol='RNA'))
367 368
370 """The Selection object "#Ap4Aase:Glu | #RNA@C8" contains the spin '*C*' of the mol 'RNA'.""" 371 372 # The Selection object. 373 obj = Selection("#Ap4Aase:Glu | #RNA@C8") 374 375 # Check if the molecule is in the selection. 376 self.assert_(obj.contains_spin(spin_name='*C*', mol='RNA'))
377 378
379 - def test_Selection_memory(self):
380 """Test that the Selection object has no memory of previous selections.""" 381 382 # The original Selection object. 383 obj = Selection(":1@16") 384 385 # The new Selection object. 386 obj = Selection(":13") 387 388 # Test the highest level object. 389 self.assertEqual(obj._union, None) 390 self.assertEqual(obj._intersect, None) 391 self.assertEqual(obj.molecules, []) 392 self.assertEqual(obj.residues, [13]) 393 self.assertEqual(obj.spins, [])
394 395
397 """The Selection object ":1-70" contains the res ':1'.""" 398 399 # The Selection object. 400 obj = Selection(":1-70") 401 402 # Check that the residue ID is in the selection. 403 self.assert_(obj.contains_spin_id(':1'))
404 405
407 """The Selection object ":1-70" does not contain the res ':71'.""" 408 409 # The Selection object. 410 obj = Selection(":1-70") 411 412 # Check that the residue ID is in the selection. 413 self.assert_(not obj.contains_spin_id(':71'))
414 415
417 """The Selection object ":1-70" contains the spin ':1@N'.""" 418 419 # The Selection object. 420 obj = Selection(":1-70") 421 422 # Check that the residue ID is in the selection. 423 self.assert_(obj.contains_spin_id(':1@N'))
424 425
427 """The Selection object ":1-70" does not contain the spin ':71@C'.""" 428 429 # The Selection object. 430 obj = Selection(":1-70") 431 432 # Check that the residue ID is in the selection. 433 self.assert_(not obj.contains_spin_id(':71@C'))
434 435
437 """Test the lib.selection.parse_token() function on the string '1'.""" 438 439 # Parse the token. 440 list = parse_token('1') 441 442 # Check the list elements. 443 self.assertEqual(len(list), 1) 444 self.assertEqual(list[0], 1)
445 446
448 """Test the lib.selection.parse_token() function on the string '-4'.""" 449 450 # Parse the token. 451 list = parse_token('-4') 452 453 # Check the list elements. 454 self.assertEqual(len(list), 1) 455 self.assertEqual(list[0], -4)
456 457
459 """Test the lib.selection.parse_token() function on the string 'G'.""" 460 461 # Parse the token. 462 list = parse_token('G') 463 464 # Check the list elements. 465 self.assertEqual(len(list), 1) 466 self.assertEqual(list[0], 'G')
467 468
470 """Test the lib.selection.parse_token() function on the string 'N*'.""" 471 472 # Parse the token. 473 list = parse_token('N*') 474 475 # Check the list elements. 476 self.assertEqual(len(list), 1) 477 self.assertEqual(list[0], 'N*')
478 479
481 """Test the lib.selection.parse_token() function on the string '1-10'.""" 482 483 # Parse the token. 484 list = parse_token('1-10') 485 486 # Check the list elements. 487 self.assertEqual(len(list), 10) 488 for i in range(1, 11): 489 self.assertEqual(list[i-1], i)
490 491
493 """Test the lib.selection.parse_token() function on the string '-10--1'.""" 494 495 # Parse the token. 496 list = parse_token('-10--1') 497 498 # Check the list elements. 499 self.assertEqual(len(list), 10) 500 j = 0 501 for i in range(-10, -2): 502 self.assertEqual(list[j], i) 503 j = j + 1
504 505
507 """Test the lib.selection.parse_token() function on the string '-2, 1'.""" 508 509 # Parse the token. 510 list = parse_token('-2, 1') 511 512 # Check the list elements. 513 self.assertEqual(len(list), 2) 514 self.assertEqual(list[0], -2) 515 self.assertEqual(list[1], 1)
516 517
519 """Test the lib.selection.parse_token() function on the string 'N,CA'.""" 520 521 # Parse the token. 522 list = parse_token('N,CA') 523 524 # Check the list elements. 525 self.assertEqual(len(list), 2) 526 self.assertEqual(list[0], 'N') 527 self.assertEqual(list[1], 'CA')
528 529
531 """Test the lib.selection.parse_token() function on the string '76,Ala'.""" 532 533 # Parse the token. 534 list = parse_token('76,Ala') 535 536 # Check the list elements. 537 self.assertEqual(len(list), 2) 538 self.assertEqual(list[0], 76) 539 self.assertEqual(list[1], 'Ala')
540 541
543 """Test the lib.selection.parse_token() function on the string '1,3-5'.""" 544 545 # Parse the token. 546 list = parse_token('1,3-5') 547 548 # Check the list elements. 549 self.assertEqual(len(list), 4) 550 self.assertEqual(list[0], 1) 551 self.assertEqual(list[1], 3) 552 self.assertEqual(list[2], 4) 553 self.assertEqual(list[3], 5)
554 555
557 """Test the lib.selection.parse_token() function on the string '3-5,NH'.""" 558 559 # Parse the token. 560 list = parse_token('3-5,NH') 561 562 # Check the list elements. 563 self.assertEqual(len(list), 4) 564 self.assertEqual(list[0], 3) 565 self.assertEqual(list[1], 4) 566 self.assertEqual(list[2], 5) 567 self.assertEqual(list[3], 'NH')
568 569
571 """Test the lib.selection.parse_token() function on the string '3-6, 8, Gly'.""" 572 573 # Parse the token. 574 list = parse_token('3-6, 8, Gly') 575 576 # Check the list elements. 577 self.assertEqual(len(list), 6) 578 self.assertEqual(list[0], 3) 579 self.assertEqual(list[1], 4) 580 self.assertEqual(list[2], 5) 581 self.assertEqual(list[3], 6) 582 self.assertEqual(list[4], 8) 583 self.assertEqual(list[5], 'Gly')
584 585
586 - def test_tokenise1(self):
587 """Test the lib.selection.tokenise() function on the string '@1'.""" 588 589 # Tokenise. 590 mol_token, res_token, spin_token = tokenise('@1') 591 592 # Check the tokens. 593 self.assertEqual(mol_token, None) 594 self.assertEqual(res_token, None) 595 self.assertEqual(spin_token, '1')
596 597
598 - def test_tokenise2(self):
599 """Test the lib.selection.tokenise() function on the string ':-4'.""" 600 601 # Tokenise. 602 mol_token, res_token, spin_token = tokenise(':-4') 603 604 # Check the tokens. 605 self.assertEqual(mol_token, None) 606 self.assertEqual(res_token, '-4') 607 self.assertEqual(spin_token, None)
608 609
610 - def test_tokenise3(self):
611 """Test the lib.selection.tokenise() function on the string '#CaM'.""" 612 613 # Tokenise. 614 mol_token, res_token, spin_token = tokenise('#CaM') 615 616 # Check the tokens. 617 self.assertEqual(mol_token, 'CaM') 618 self.assertEqual(res_token, None) 619 self.assertEqual(spin_token, None)
620 621
622 - def test_tokenise4(self):
623 """Test the lib.selection.tokenise() function on the string ':G@N3'.""" 624 625 # Tokenise. 626 mol_token, res_token, spin_token = tokenise(':G@N3') 627 628 # Check the tokens. 629 self.assertEqual(mol_token, None) 630 self.assertEqual(res_token, 'G') 631 self.assertEqual(spin_token, 'N3')
632 633
634 - def test_tokenise5(self):
635 """Test the lib.selection.tokenise() function on the string '#OMP@NH'.""" 636 637 # Tokenise. 638 mol_token, res_token, spin_token = tokenise('#OMP@NH') 639 640 # Check the tokens. 641 self.assertEqual(mol_token, 'OMP') 642 self.assertEqual(res_token, None) 643 self.assertEqual(spin_token, 'NH')
644 645
646 - def test_tokenise6(self):
647 """Test the lib.selection.tokenise() function on the string '#Lyso:20-50'.""" 648 649 # Tokenise. 650 mol_token, res_token, spin_token = tokenise('#Lyso:20-50') 651 652 # Check the tokens. 653 self.assertEqual(mol_token, 'Lyso') 654 self.assertEqual(res_token, '20-50') 655 self.assertEqual(spin_token, None)
656 657
658 - def test_tokenise7(self):
659 """Test the lib.selection.tokenise() function on the string '#Ap4Aase:*@N,CA'.""" 660 661 # Tokenise. 662 mol_token, res_token, spin_token = tokenise('#Ap4Aase:*@N,CA') 663 664 # Check the tokens. 665 self.assertEqual(mol_token, 'Ap4Aase') 666 self.assertEqual(res_token, '*') 667 self.assertEqual(spin_token, 'N,CA')
668 669
670 - def test_tokenise8(self):
671 """Test the lib.selection.tokenise() function on the string '@N*'.""" 672 673 # Tokenise. 674 mol_token, res_token, spin_token = tokenise('@N*') 675 676 # Check the tokens. 677 self.assertEqual(mol_token, None) 678 self.assertEqual(res_token, None) 679 self.assertEqual(spin_token, 'N*')
680 681
683 """Test failure of the lib.selection.tokenise() function on the string '@N@1'. 684 685 This tests for a duplicated atom identifier. 686 """ 687 688 # Tokenise an invalid string. 689 self.assertRaises(RelaxError, tokenise, '@N@1')
690 691
693 """Test failure of the lib.selection.tokenise() function on the string ':*@N@1'. 694 695 This tests for a duplicated atom identifier. 696 """ 697 698 # Tokenise an invalid string. 699 self.assertRaises(RelaxError, tokenise, ':*@N@1')
700 701
703 """Test failure of the lib.selection.tokenise() function on the string '@N:*@1'. 704 705 This tests for a duplicated atom identifier. 706 """ 707 708 # Tokenise an invalid string. 709 self.assertRaises(RelaxError, tokenise, '@N:*@1')
710 711
713 """Test failure of the lib.selection.tokenise() function on the string ':1:2'. 714 715 This tests for a duplicated residue identifier. 716 """ 717 718 # Tokenise an invalid string. 719 self.assertRaises(RelaxError, tokenise, ':1:2')
720 721
723 """Test failure of the lib.selection.tokenise() function on the string '#None:1:Ala'. 724 725 This tests for a duplicated residue identifier. 726 """ 727 728 # Tokenise an invalid string. 729 self.assertRaises(RelaxError, tokenise, '#None:1:Ala')
730 731
733 """Test failure of the lib.selection.tokenise() function on the string ':1:Ala@N'. 734 735 This tests for a duplicated residue identifier. 736 """ 737 738 # Tokenise an invalid string. 739 self.assertRaises(RelaxError, tokenise, ':1:Ala@N')
740 741
743 """Test failure of the lib.selection.tokenise() function on the string '#A#B'. 744 745 This tests for a duplicated molecule identifier. 746 """ 747 748 # Tokenise an invalid string. 749 self.assertRaises(RelaxError, tokenise, '#A#B')
750 751
753 """Test failure of the lib.selection.tokenise() function on the string '#A#B:Leu'. 754 755 This tests for a duplicated molecule identifier. 756 """ 757 758 # Tokenise an invalid string. 759 self.assertRaises(RelaxError, tokenise, '#A#B:Leu')
760 761
763 """Test failure of the lib.selection.tokenise() function on the string '#A#C@CA'. 764 765 This tests for a duplicated molecule identifier. 766 """ 767 768 # Tokenise an invalid string. 769 self.assertRaises(RelaxError, tokenise, '#A#C@CA')
770 771
773 """Test failure of the lib.selection.tokenise() function on the string '@CA#A'. 774 775 This tests for an out of order '@' identifier. 776 """ 777 778 # Tokenise an invalid string. 779 self.assertRaises(RelaxError, tokenise, '@CA#A')
780 781
783 """Test failure of the lib.selection.tokenise() function on the string '@CA:Pro'. 784 785 This tests for an out of order '@' identifier. 786 """ 787 788 # Tokenise an invalid string. 789 self.assertRaises(RelaxError, tokenise, '@CA:Pro')
790 791
793 """Test failure of the lib.selection.tokenise() function on the string '@CA#Z:Pro'. 794 795 This tests for an out of order '@' identifier. 796 """ 797 798 # Tokenise an invalid string. 799 self.assertRaises(RelaxError, tokenise, '@CA#Z:Pro')
800 801
803 """Test failure of the lib.selection.tokenise() function on the string '@CA:Pro'. 804 805 This tests for an out of order ':' identifier. 806 """ 807 808 # Tokenise an invalid string. 809 self.assertRaises(RelaxError, tokenise, '@CA:Pro')
810 811
813 """Test failure of the lib.selection.tokenise() function on the string ':Glu#X'. 814 815 This tests for an out of order ':' identifier. 816 """ 817 818 # Tokenise an invalid string. 819 self.assertRaises(RelaxError, tokenise, ':Glu#X')
820 821
823 """Test failure of the lib.selection.tokenise() function on the string '#1@12423:Glu'. 824 825 This tests for an out of order ':' identifier. 826 """ 827 828 # Tokenise an invalid string. 829 self.assertRaises(RelaxError, tokenise, ':Glu#X')
830 831
833 """Test failure of the lib.selection.tokenise() function on the string ':1-160#A'. 834 835 This tests for an out of order '#' identifier. 836 """ 837 838 # Tokenise an invalid string. 839 self.assertRaises(RelaxError, tokenise, ':1-160#A')
840 841
843 """Test failure of the lib.selection.tokenise() function on the string '@N,CA#A'. 844 845 This tests for an out of order '#' identifier. 846 """ 847 848 # Tokenise an invalid string. 849 self.assertRaises(RelaxError, tokenise, '@N,CA#A')
850 851
853 """Test failure of the lib.selection.tokenise() function on the string '@N:-10#Zip'. 854 855 This tests for an out of order '#' identifier. 856 """ 857 858 # Tokenise an invalid string. 859 self.assertRaises(RelaxError, tokenise, '@N:-10#Zip')
860 861
863 """Test failure of the lib.selection.tokenise() function on the string '13'. 864 865 This tests for an improper selection string. 866 """ 867 868 # Tokenise an invalid string. 869 self.assertRaises(RelaxError, tokenise, '13')
870 871
873 """Test failure of the lib.selection.tokenise() function on the string 'XXX'. 874 875 This tests for an improper selection string. 876 """ 877 878 # Tokenise an invalid string. 879 self.assertRaises(RelaxError, tokenise, 'XXX')
880 881
883 """Test failure of the lib.selection.tokenise() function on the string ''. 884 885 This tests for an improper selection string. 886 """ 887 888 # Tokenise an invalid string. 889 self.assertRaises(RelaxError, tokenise, '')
890