def test_mixed_array1(): input_str = '*5\r\n:1\r\n:2\r\n:3\r\n:4\r\n$6\r\nfoobar\r\n' output = parsed(input_str) output_expected = [1, 2, 3, 4, 'foobar'] assert output == output_expected
def test_mixed_array2(): input_str = '*2\r\n*0\r\n:1\r\n' output = parsed(input_str) output_expected = [[], 1] assert output == output_expected
def test_array_int(): input_str = '*3\r\n:1\r\n:2\r\n:3\r\n' output = parsed(input_str) output_expected = [1, 2, 3] assert output == output_expected
def test_array_bulk_string(): input_str = '*2\r\n$3\r\nfoo\r\n$3\r\nbar\r\n' output = parsed(input_str) output_expected = ['foo', 'bar'] assert output == output_expected
def test_simple_string(): input_str = '+OK\r\n' output = parsed(input_str) output_expected = 'OK' assert output == output_expected
def test_null_string(): input_str = '$-1\r\n' output = parsed(input_str) output_expected = None assert output == output_expected
def test_bulk_string(): input_str = '$6\r\nfoobar\r\n' output = parsed(input_str) output_expected = 'foobar' assert output == output_expected
def test_nested_array1(): input_str = '*3\r\n*3\r\n:1\r\n:2\r\n:3\r\n*2\r\n+Foo\r\n-Bar\r\n:1\r\n' output = parsed(input_str) output_expected = [[1, 2, 3], ['Foo', 'Bar'], 1] assert output == output_expected
def test_command2(): input_str = '*2\r\n$3\r\nGET\r\n$1\r\na\r\n' output = parsed(input_str) output_expected = ['GET', 'a'] assert output == output_expected
def test_integer(): input_str = ':1\r\n' output = parsed(input_str) output_expected = 1 assert output == output_expected
def test_error(): input_str = '-Error message\r\n' output = parsed(input_str) output_expected = 'Error message' assert output == output_expected
def test_command1(): input_str = '*3\r\n$3\r\nSET\r\n$1\r\na\r\n$12\r\nHello World!\r\n' output = parsed(input_str) output_expected = ['SET', 'a', 'Hello World!'] assert output == output_expected
def test_nested_array2(): input_str = '*1\r\n*1\r\n*1\r\n:1\r\n' output = parsed(input_str) output_expected = [[[1]]] assert output == output_expected
def test_null_array(): input_str = '*-1\r\n' output = parsed(input_str) output_expected = None assert output == output_expected
def test_empty_string(): input_str = '$0\r\n\r\n' output = parsed(input_str) output_expected = '' assert output == output_expected
def test_empty_array(): input_str = '*0\r\n' output = parsed(input_str) output_expected = [] assert output == output_expected
#print(a.dev_l) #print(a.ranges) example = ["hello.txt"] example2 = ["harry_1.txt", "harry_2.txt", "harry_3.txt"] set_of_books = [ "harry_1.txt", "harry_2.txt", "harry_3.txt", "harry_4.txt", "harry_5.txt", "harry_6.txt", "harry_7.txt", "alice_in_wonderland.txt", "sherlock_holmes.txt", "gullivers_travels.txt", "lotf.txt", "mysterious_affair.txt", "oliver_twist.txt", "peter_pan.txt", "scarlet_letter.txt", "holes.txt", "tkm.txt", "infinite_jest.txt" ] finite_words = parsed("a_good_amount.txt") test = Assembly(set_of_books) from openpyxl import Workbook wb = Workbook() ws = wb.active ws['A1'] = "WORD" ws['B1'] = "SCORE" X = comparev2(finite_words, test) N = len(X) + 1 print(X)