# Path: seedbox/db/models.py
# class Model(object):
# class Torrent(Model):
# class MediaFile(Model):
# class AppState(Model):
#     PK_NAME = 'id'
#     PK_NAME = 'torrent_id'
#     PK_NAME = 'media_id'
#     PK_NAME = 'name'
#     def __init__(self, **kwds):
#     def as_dict(self):
#     def items(self):
#     def __eq__(self, other):
#     def __iter__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, value):
#     def __contains__(self, name):
#     def __str__(self):
#     def pk_filter(cls, value=None):
#     def make_empty(cls):
#     def __init__(self, torrent_id, name, created_at=None, updated_at=None,
#                  state=None, retry_count=None, failed=None, error_msg=None,
#                  invalid=None, purged=None, media_files=None):
#     def __init__(self, media_id, torrent_id, filename, file_ext,
#                  file_path=None, size=None, compressed=None, synced=None,
#                  missing=None, skipped=None, error_msg=None, total_time=None):
#     def __init__(self, name, value):
# 
# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):


import six
import testtools
from testtools import matchers
from seedbox.db import models
from seedbox.tests import test
        self.assertEqual(fake.arg_a, 1)

        val = fake['arg_a']
        self.assertEqual(val, 1)

        self.assertIn('arg_a', fake)
        self.assertNotIn('arg_z', fake)

        self.assertIsInstance(str(fake), six.string_types)

        self.assertThat(lambda: fake['arg_z'],
                        matchers.Raises(matchers.MatchesException(KeyError)))

        with testtools.ExpectedException(KeyError):
            fake['arg_z'] = 1

        fake.arg_b = other
        fake.arg_c = [other]
        self.assertEqual(len(fake.as_dict()), 3)

    def test_torrent_model(self):
        torrent = models.Torrent.make_empty()
        self.assertIsInstance(torrent, models.Torrent)

    def test_mediafile_model(self):
        mf = models.MediaFile.make_empty()
        self.assertIsInstance(mf, models.MediaFile)

    def test_appstate_model(self):
        appstate = models.AppState.make_empty()

# Path: seedbox/db/models.py
# class Model(object):
# class Torrent(Model):
# class MediaFile(Model):
# class AppState(Model):
#     PK_NAME = 'id'
#     PK_NAME = 'torrent_id'
#     PK_NAME = 'media_id'
#     PK_NAME = 'name'
#     def __init__(self, **kwds):
#     def as_dict(self):
#     def items(self):
#     def __eq__(self, other):
#     def __iter__(self):
#     def __getitem__(self, name):
#     def __setitem__(self, name, value):
#     def __contains__(self, name):
#     def __str__(self):
#     def pk_filter(cls, value=None):
#     def make_empty(cls):
#     def __init__(self, torrent_id, name, created_at=None, updated_at=None,
#                  state=None, retry_count=None, failed=None, error_msg=None,
#                  invalid=None, purged=None, media_files=None):
#     def __init__(self, media_id, torrent_id, filename, file_ext,
#                  file_path=None, size=None, compressed=None, synced=None,
#                  missing=None, skipped=None, error_msg=None, total_time=None):
#     def __init__(self, name, value):
# 
# 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/tests/db/test_models.py
import six
import testtools
from testtools import matchers
from seedbox.db import models
from seedbox.tests import test

        self.assertEqual(fake.arg_a, 1)

        val = fake['arg_a']
        self.assertEqual(val, 1)

        self.assertIn('arg_a', fake)
        self.assertNotIn('arg_z', fake)

        self.assertIsInstance(str(fake), six.string_types)

        self.assertThat(lambda: fake['arg_z'],
                        matchers.Raises(matchers.MatchesException(KeyError)))

        with testtools.ExpectedException(KeyError):
            fake['arg_z'] = 1

        fake.arg_b = other
        fake.arg_c = [other]
        self.assertEqual(len(fake.as_dict()), 3)

    def test_torrent_model(self):
        torrent = models.Torrent.make_empty()
        self.assertIsInstance(torrent, models.Torrent)

    def test_mediafile_model(self):
        mf = models.MediaFile.make_empty()
        self.assertIsInstance(mf, models.MediaFile)

    def test_appstate_model(self):
        appstate = models.AppState.make_empty()

        self.assertIsInstance(appstate, models.AppState)