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)
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)
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, ))
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)
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, ))
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)
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))
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)
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)