# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):
# 
# Path: seedbox/torrent/bencode.py
# def bencode(x):
#     """Public method for encoding message
# 
#     :param x: message
#     :return: encoded string
#     :rtype: string
#     """
#     r = []
#     encode_func[type(x)](x, r)
#     return b''.join(r)


from seedbox.tests import test
from seedbox.torrent import bencode
        (False, b'i0e'),
        (b'spam', b'4:spam'),
        (b'parrot sketch', b'13:parrot sketch'),
        ([b'parrot sketch', 42], b'l13:parrot sketchi42ee'),
        ({b'foo': 42,
          b'bar': b'spam'},
         b'd3:bar4:spam3:fooi42ee'),
    )

    def test_bencode_known_values(self):
        for plain, encoded in self.knownValues:
            result = bencode.bencode(plain)
            self.assertEqual(encoded, result)

    def test_bdecode_known_values(self):
        for plain, encoded in self.knownValues:
            result = bencode.bdecode(encoded)
            self.assertEqual(plain, result)

    def test_roundtrip_encoded(self):
        for plain, encoded in self.knownValues:
            result = bencode.bdecode(encoded)
            self.assertEqual(encoded, bencode.bencode(result))

    def test_roundtrip_decoded(self):
        for plain, encoded in self.knownValues:
            result = bencode.bencode(plain)
            self.assertEqual(plain, bencode.bdecode(result))



# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):
# 
# Path: seedbox/torrent/bencode.py
# def bencode(x):
#     """Public method for encoding message
# 
#     :param x: message
#     :return: encoded string
#     :rtype: string
#     """
#     r = []
#     encode_func[type(x)](x, r)
#     return b''.join(r)


# Path: seedbox/tests/torrent/test_bencode.py
from seedbox.tests import test
from seedbox.torrent import bencode

        (False, b'i0e'),
        (b'spam', b'4:spam'),
        (b'parrot sketch', b'13:parrot sketch'),
        ([b'parrot sketch', 42], b'l13:parrot sketchi42ee'),
        ({b'foo': 42,
          b'bar': b'spam'},
         b'd3:bar4:spam3:fooi42ee'),
    )

    def test_bencode_known_values(self):
        for plain, encoded in self.knownValues:
            result = bencode.bencode(plain)
            self.assertEqual(encoded, result)

    def test_bdecode_known_values(self):
        for plain, encoded in self.knownValues:
            result = bencode.bdecode(encoded)
            self.assertEqual(plain, result)

    def test_roundtrip_encoded(self):
        for plain, encoded in self.knownValues:
            result = bencode.bdecode(encoded)
            self.assertEqual(encoded, bencode.bencode(result))

    def test_roundtrip_decoded(self):
        for plain, encoded in self.knownValues:
            result = bencode.bencode(plain)
            self.assertEqual(plain, bencode.bdecode(result))



class IllegaleValues(test.BaseTestCase):