Esempio n. 1
0
    def test_multiple_token_strip_size(self):
        """ Test that stripping a single token entry results in only one entry being
			 removed. """
        tok = token.Token(1, 2)
        tok_tuples = tok.extract_tuples()
        tok_tuples = tok.strip_token_tup_head(tok_tuples)
        self.assertEqual(len(tok_tuples), 1)
Esempio n. 2
0
    def test_empty_token_strip(self):
        """ Test that attempting to strip the head off an empty token still
			 results in an empty token. """
        tok = token.Token()
        tok_tuples = tok.extract_tuples()
        tok_tuples = tok.strip_token_tup_head(tok_tuples)
        self.assertEqual(len(tok_tuples), 0)
Esempio n. 3
0
    def test_recurring_token_strip(self):
        """ Test that two subsequent strip operations removes the expected number
			 of entries. """
        tok = token.Token(1, 2, 3)
        tok_tuples = tok.extract_tuples()
        tok_tuples = tok.strip_token_tup_head(tok_tuples)
        tok_tuples = tok.strip_token_tup_head(tok_tuples)
        self.assertEqual(tok_tuples, (3, ))
Esempio n. 4
0
    def test_empty_token_size(self):
        """ Test that creating and extracting an empty token results in no
			 tuples. """
        tok = token.Token()
        tok_tuples = tok.extract_tuples()
        self.assertEqual(len(tok_tuples), 0)
Esempio n. 5
0
 def test_multiple_token_strip(self):
     """ Test that stripping a single token entry removes the leading entry. """
     tok = token.Token(1, 2)
     tok_tuples = tok.extract_tuples()
     tok_tuples = tok.strip_token_tup_head(tok_tuples)
     self.assertEqual(tok_tuples, (2, ))
Esempio n. 6
0
 def test_single_token_strip(self):
     """ Test that stripping a single entry from a token results in no entries. """
     tok = token.Token(123456789)
     tok_tuples = tok.extract_tuples()
     tok_tuples = tok.strip_token_tup_head(tok_tuples)
     self.assertEqual(len(tok_tuples), 0)
Esempio n. 7
0
    def test_multiple_tokens_value(self):
        """ Test that creating multiple token entries and extracting them returns
			 the expected number of tuples. """
        tok = token.Token(1, 2)
        tok_tuples = tok.extract_tuples()
        self.assertEqual(tok_tuples, (1, 2))
Esempio n. 8
0
    def test_single_token_value(self):
        """ Test that creating and extracting a single tuple from a basic token
			 results in the same value returned. """
        tok = token.Token(123456789)
        tok_tuples = tok.extract_tuples()
        self.assertEqual(tok_tuples[0], 123456789)
Esempio n. 9
0
    def test_single_token_size(self):
        """ Test that creating and extracting a single tuple from a basic token
			 results in a token of size 1. """
        tok = token.Token(123456789)
        tok_tuples = tok.extract_tuples()
        self.assertEqual(len(tok_tuples), 1)