def test_mixed_complex(self): """ Test that a mixed complex expression is inflated correctly. """ self.n = bencode.inflate("li1ei2eed3:key5:valuee") self.assertEqual(self.n, ["li1ei2ee", "d3:key5:valuee"])
def test_long_string(self): """ Test that an expression containing a long string is inflated correctly. """ self.n = bencode.inflate("i1e15:averylongstringi2e") self.assertEqual(self.n, ["i1e", "15:averylongstring", "i2e"])
def test_mixed_simple(self): """ Test that a mixed simple expression is inflated correctly. """ self.n = bencode.inflate("3:onei1e3:twoi2e") self.assertEqual(self.n, ["3:one", "i1e", "3:two", "i2e"])
def test_simple(self): """ Test that a simple expression is inflated correctly. """ self.n = bencode.inflate("i1e") self.assertEqual(self.n, ["i1e"])
def test_longer(self): """ Test that a longer expression is inflated correctly. """ self.n = bencode.inflate("i1ei2ei3e") self.assertEqual(self.n, ["i1e", "i2e", "i3e"])