def test_empty_list(self): """ Test that an empty list is encoded correctly. """ self.n = bencode.encode_list([]) self.assertEquals(self.n, "le")
def test_mixed_list(self): """ Test that a mixed list is encoded correctly. """ self.n = bencode.encode_list([1, "one"]) self.assertEquals(self.n, "li1e3:onee")
def test_nested_list(self): """ Test that a nested list is encoded correctly. """ self.n = bencode.encode_list([[1, 2], [3, 4]]) self.assertEquals(self.n, "lli1ei2eeli3ei4eee")
def test_simple_list(self): """ Test that a one item list is encoded correctly. """ self.n = bencode.encode_list([1]) self.assertEquals(self.n, "li1ee")
def test_longer_list(self): """ Test that a longer list is encoded correctly. """ self.n = bencode.encode_list([1, 2, 3]) self.assertEquals(self.n, "li1ei2ei3ee")