def test_bg(self): input = [ ("B", 1), ("u", 1), (1, 1), ("l", 1), ("g", 1), ("a", 1), ("r", 1), ("i", 1), (1, 2), (4, 3), ("a", 1), (3, 1), ] self.assertEqual("Bulgaria", solution.extract_type(input, str))
def test_num(self): input = [ ("B", 1), ("u", 1), (1, 1), ("l", 1), ("g", 1), ("a", 1), ("r", 1), ("i", 1), (1, 2), (4, 3), ("a", 1), (3, 1), ] self.assertEqual("1114443", solution.extract_type(input, int))
def test_extract_type_with_bool(self): self.assertEqual(s.extract_type(self.data, bool), 'TrueTrueFalseFalse')
def test_extract_type_with_set(self): self.assertEqual(s.extract_type(self.data, set), 'set()set()set()set()set(){1, 2}{1, 2}{1, 2}')
def test_extract_type_with_tuple(self): self.assertEqual(s.extract_type(self.data, tuple), '(1, 2)(1, 2)(3, 4)(3, 4)(3, 4)()()()')
def test_with_empty_list(self): self.assertEqual('', s.extract_type([], type))
def test_num(self): input = [('B', 1), ('u', 1), (1, 1), ('l', 1), ('g', 1), ('a', 1), ('r', 1), ('i', 1), (1, 2), (4, 3), ('a', 1), (3, 1)] self.assertEqual("1114443", s.extract_type(input, int))
def test_python(self): input = [('p', 1), ('y', 1), ('t', 1), ('h', 1), ('o', 1), ('n', 1)] self.assertEqual("python", s.extract_type(input, str))
def test_some_types(self): input = [("a", 1), (5, 10), ("p", 2), ("l", 1), ("e", 1), (14, 2)] self.assertEqual("apple", solution.extract_type(input, str))
def test_python(self): input = [("p", 1), ("y", 1), ("t", 1), ("h", 1), ("o", 1), ("n", 1)] self.assertEqual("python", solution.extract_type(input, str))
def test_fave(self): input = [("r", 1), ("o", 1), (1, 1), ("s", 2), ("o", 1), (5, 0), ("n", 1), ("e", 1), (1, 2), ("r", 1), ("o", 1)] self.assertEqual("rossonero", solution.extract_type(input, str))
def test_snake(self): input = [('s', 1), ('n', 1), ('a', 1), ('k', 1), ('e', 1), (55, 1)] self.assertEqual("snake", solution.extract_type(input, str))
def test_number(self): input = [('hg', 19), ('h', 15), (1, 4), ('kk', 4), ('yu', 1), ('a', 1), ('k', 1), ('qqw', 1), (1, 2), (4, 3), ('kl', 1), (3, 10)] self.assertEqual("1111114443333333333", solution.extract_type(input, int))
def test_bool(self): input_ = [(True, 1), ("and", 1), (False, 1), ('==', 1), (False, 1)] self.assertEqual("TrueFalseFalse", s.extract_type(input_, bool))
def test_int(self): input_ = [({'a': 10}, 1), (1, 4), (0.2, 3), (2, 3), (True, 2), (3, 2), ("something", 1), (4, 1), (5, 0)] self.assertEqual("1111222334", s.extract_type(input_, int))
def test_gopher(self): input_ = [('g', 1), ((1, 2), 3), ('op', 1), (3.1415, 1), ('h', 1), (False, 1), ('e', 1), ([], 5), ('r', 1)] self.assertEqual("gopher", s.extract_type(input_, str))
def test_fave(self): input = [('r', 1), ('o', 1), (1, 1), ('s', 2), ('o', 1), (5, 0), ('n', 1), ('e', 1), (1, 2), ('r', 1), ('o', 1)] self.assertEqual("rossonero", s.extract_type(input, str))
def test_list_simitli(self): input_ = [(['S', 'I', 'M'], 1), (type, 2), (['I'], 1), ({}, 10), (['T', 'L', 'I'], 1), ([1, 2, 3, 4], 0), (13, 1)] self.assertEqual("['S', 'I', 'M']['I']['T', 'L', 'I']", s.extract_type(input_, list))
def test_with_ints_and_floats(self): self.assertEqual("42.151.3", s.extract_type( [(1, 1), (42.15, 1), (0, 0), (1.3, 1)], float))
def test_america(self): input = [('A', 1), ('m', 1), ('e', 1), ('r', 1), ('i', 1), (33, 1), (453, 1), (2, 1), ('c', 1), (4, 3), ('a', 1), (3, 1)] self.assertEqual("America", solution.extract_type(input, str))
def test_aalabbalaa(self): input_ = [('a', 2), ('l', 1), ('error', 0), ('a', 1), ('b', 2), ('a', 1), ('l', 1), ('a', 2)] self.assertEqual("aalabbalaa", s.extract_type(input_, str))
def test_extract_type_with_string(self): self.assertEqual(s.extract_type(self.data, str), 'aizzzzz')
def test_fave(self): input = [('r', 1), ('o', 1), (1, 1), ('s', 2), ('o', 1), (5, 0), ('n', 1), ('e', 1), (1, 2), ('r', 1), ('o', 1)] self.assertEqual("rossonero", solution.extract_type(input, str))
def test_extract_type_with_list(self): self.assertEqual(s.extract_type(self.data, list), '[][][][][1, 2][1, 2][3, 4][3, 4][3, 4]')
def test_bg(self): input = [('B', 1), ('u', 1), (1, 1), ('l', 1), ('g', 1), ('a', 1), ('r', 1), ('i', 1), (1, 2), (4, 3), ('a', 1), (3, 1)] self.assertEqual("Bulgaria", solution.extract_type(input, str))
def test_extract_type_with_dict(self): self.assertEqual(s.extract_type(self.data, dict), "{}{'a': 2}{'a': 2}")
def test_num(self): input = [('B', 1), ('u', 1), (1, 1), ('l', 1), ('g', 1), ('a', 1), ('r', 1), ('i', 1), (1, 2), (4, 3), ('a', 1), (3, 1)] self.assertEqual("1114443", solution.extract_type(input, int))
def test_int(self): input_ = [({ 'a': 10 }, 1), (1, 4), (0.2, 3), (2, 3), (True, 2), (3, 2), ("something", 1), (4, 1), (5, 0)] self.assertEqual("1111222334", s.extract_type(input_, int))
def test_python(self): input = [('p', 1), ('y', 1), ('t', 1), ('h', 1), ('o', 1), ('n', 1)] self.assertEqual("python", solution.extract_type(input, str))
def test_some_types(self): input = [('a', 1), (5, 10), ('p', 2), ('l', 1), ('e', 1), (14, 2)] self.assertEqual("apple", solution.extract_type(input, str))
def test_some_types(self): input = [('a', 1), (5, 10), ('p', 2), ('l', 1), ('e', 1), (14, 2)] self.assertEqual("apple", s.extract_type(input, str))
def test_bg(self): input = [('B', 1), ('u', 1), (1, 1), ('l', 1), ('g', 1), ('a', 1), ('r', 1), ('i', 1), (1, 2), (4, 3), ('a', 1), (3, 1)] self.assertEqual("Bulgaria", s.extract_type(input, str))
def test_string_with_different_types(self): fizzbuzz_input = [('f', 1), (5, 10), ('i', 1), (0.3, 100), ('z', 2), ('bu', 1), ('z', 2)] self.assertEqual("fizzbuzz", s.extract_type(fizzbuzz_input, str))
def test_with_no_symbols_of_given_type(self): self.assertEqual('', s.extract_type([('a', 1), ('b', 1)], int))
def test_string_and_list(self): fizzbuzz_input = [('f', 1), ([], 0), ('i', 1), ('z', 2), ('bu', 1), ('z', 2)] self.assertEqual("fizzbuzz", s.extract_type(fizzbuzz_input, str))
def test_cheese(self): input = [('c', 1), ('h', 1), (1, 1), ('e', 2), ('s', 1), (5, 0), (12, 1), (55, 1), (1, 2), ('e', 1), (1, 1)] self.assertEqual("cheese", solution.extract_type(input, str))