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