Exemplo n.º 1
0
    def test_parse_token_single_element_neg_num(self):
        """Test the lib.selection.parse_token() function on the string '-4'."""

        # Parse the token.
        list = parse_token('-4')

        # Check the list elements.
        self.assertEqual(len(list), 1)
        self.assertEqual(list[0], -4)
Exemplo n.º 2
0
    def test_parse_token_single_element_wildcard_name(self):
        """Test the lib.selection.parse_token() function on the string 'N*'."""

        # Parse the token.
        list = parse_token('N*')

        # Check the list elements.
        self.assertEqual(len(list), 1)
        self.assertEqual(list[0], 'N*')
Exemplo n.º 3
0
    def test_parse_token_single_element_wildcard_name(self):
        """Test the lib.selection.parse_token() function on the string 'N*'."""

        # Parse the token.
        list = parse_token('N*')

        # Check the list elements.
        self.assertEqual(len(list), 1)
        self.assertEqual(list[0], 'N*')
Exemplo n.º 4
0
    def test_parse_token_single_element_neg_num(self):
        """Test the lib.selection.parse_token() function on the string '-4'."""

        # Parse the token.
        list = parse_token('-4')

        # Check the list elements.
        self.assertEqual(len(list), 1)
        self.assertEqual(list[0], -4)
Exemplo n.º 5
0
    def test_parse_token_multi_element_num_name(self):
        """Test the lib.selection.parse_token() function on the string '76,Ala'."""

        # Parse the token.
        list = parse_token('76,Ala')

        # Check the list elements.
        self.assertEqual(len(list), 2)
        self.assertEqual(list[0], 76)
        self.assertEqual(list[1], 'Ala')
Exemplo n.º 6
0
    def test_parse_token_multi_element_num(self):
        """Test the lib.selection.parse_token() function on the string '-2, 1'."""

        # Parse the token.
        list = parse_token('-2, 1')

        # Check the list elements.
        self.assertEqual(len(list), 2)
        self.assertEqual(list[0], -2)
        self.assertEqual(list[1], 1)
Exemplo n.º 7
0
    def test_parse_token_single_element_range(self):
        """Test the lib.selection.parse_token() function on the string '1-10'."""

        # Parse the token.
        list = parse_token('1-10')

        # Check the list elements.
        self.assertEqual(len(list), 10)
        for i in range(1, 11):
            self.assertEqual(list[i - 1], i)
Exemplo n.º 8
0
    def test_parse_token_multi_element_num_name(self):
        """Test the lib.selection.parse_token() function on the string '76,Ala'."""

        # Parse the token.
        list = parse_token('76,Ala')

        # Check the list elements.
        self.assertEqual(len(list), 2)
        self.assertEqual(list[0], 76)
        self.assertEqual(list[1], 'Ala')
Exemplo n.º 9
0
    def test_parse_token_multi_element_num(self):
        """Test the lib.selection.parse_token() function on the string '-2, 1'."""

        # Parse the token.
        list = parse_token('-2, 1')

        # Check the list elements.
        self.assertEqual(len(list), 2)
        self.assertEqual(list[0], -2)
        self.assertEqual(list[1], 1)
Exemplo n.º 10
0
    def test_parse_token_single_element_range(self):
        """Test the lib.selection.parse_token() function on the string '1-10'."""

        # Parse the token.
        list = parse_token('1-10')

        # Check the list elements.
        self.assertEqual(len(list), 10)
        for i in range(1, 11):
            self.assertEqual(list[i-1], i)
Exemplo n.º 11
0
    def test_parse_token_multi_element_range_name(self):
        """Test the lib.selection.parse_token() function on the string '3-5,NH'."""

        # Parse the token.
        list = parse_token('3-5,NH')

        # Check the list elements.
        self.assertEqual(len(list), 4)
        self.assertEqual(list[0], 3)
        self.assertEqual(list[1], 4)
        self.assertEqual(list[2], 5)
        self.assertEqual(list[3], 'NH')
Exemplo n.º 12
0
    def test_parse_token_single_element_neg_range(self):
        """Test the lib.selection.parse_token() function on the string '-10--1'."""

        # Parse the token.
        list = parse_token('-10--1')

        # Check the list elements.
        self.assertEqual(len(list), 10)
        j = 0
        for i in range(-10, -2):
            self.assertEqual(list[j], i)
            j = j + 1
Exemplo n.º 13
0
    def test_parse_token_multi_element_range_name(self):
        """Test the lib.selection.parse_token() function on the string '3-5,NH'."""

        # Parse the token.
        list = parse_token('3-5,NH')

        # Check the list elements.
        self.assertEqual(len(list), 4)
        self.assertEqual(list[0], 3)
        self.assertEqual(list[1], 4)
        self.assertEqual(list[2], 5)
        self.assertEqual(list[3], 'NH')
Exemplo n.º 14
0
    def test_parse_token_single_element_neg_range(self):
        """Test the lib.selection.parse_token() function on the string '-10--1'."""

        # Parse the token.
        list = parse_token('-10--1')

        # Check the list elements.
        self.assertEqual(len(list), 10)
        j = 0
        for i in range(-10, -2):
            self.assertEqual(list[j], i)
            j = j + 1