コード例 #1
0
ファイル: test_client.py プロジェクト: Gooeydev/contentful.py
    def test_entry_custom_class_explicit_first(self):
        cli = DemoClient([Cat])
        result = utils.fetch_first_and_assert(self, Cat, 'entry_custom_class_explicit_first', const.PATH_ENTRIES, cli)
        self.assertIsInstance(result, Cat)

        self.assertEqual('Happy Cat', result.name)
        self.assertEqual('gray', result.color)
        self.assertEqual(1, result.lives)
        self.assertIsInstance(result.likes, list)
        self.assertEqual(1, len(result.likes))
        self.assertEqual('cheezburger', result.likes[0])
        self.assertIsInstance(result.birthday, date)

        self.assertIsInstance(result.best_friend, Cat)
        self.assertEqual('Nyan Cat', result.best_friend.name)
        self.assertIs(result, result.best_friend.best_friend)
コード例 #2
0
    def test_entry_custom_class_explicit_first(self):
        cli = DemoClient([Cat])
        result = utils.fetch_first_and_assert(
            self, Cat, 'entry_custom_class_explicit_first', const.PATH_ENTRIES,
            cli)
        self.assertIsInstance(result, Cat)

        self.assertEqual('Happy Cat', result.name)
        self.assertEqual('gray', result.color)
        self.assertEqual(1, result.lives)
        self.assertIsInstance(result.likes, list)
        self.assertEqual(1, len(result.likes))
        self.assertEqual('cheezburger', result.likes[0])
        self.assertIsInstance(result.birthday, date)

        self.assertIsInstance(result.best_friend, Cat)
        self.assertEqual('Nyan Cat', result.best_friend.name)
        self.assertIs(result, result.best_friend.best_friend)
コード例 #3
0
ファイル: test_client.py プロジェクト: Gooeydev/contentful.py
 def test_entry_first(self):
     utils.fetch_first_and_assert(self, Entry, 'entry_first', const.PATH_ENTRIES)
コード例 #4
0
ファイル: test_client.py プロジェクト: Gooeydev/contentful.py
 def test_content_type_first(self):
     utils.fetch_first_and_assert(self, ContentType, 'content_type_first', const.PATH_CONTENT_TYPES)
コード例 #5
0
ファイル: test_client.py プロジェクト: Gooeydev/contentful.py
 def test_asset_first(self):
     utils.fetch_first_and_assert(self, Asset, 'asset_first', const.PATH_ASSETS)
コード例 #6
0
 def test_entry_first(self):
     utils.fetch_first_and_assert(self, Entry, 'entry_first',
                                  const.PATH_ENTRIES)
コード例 #7
0
 def test_content_type_first(self):
     utils.fetch_first_and_assert(self, ContentType, 'content_type_first',
                                  const.PATH_CONTENT_TYPES)
コード例 #8
0
 def test_asset_first(self):
     utils.fetch_first_and_assert(self, Asset, 'asset_first',
                                  const.PATH_ASSETS)