コード例 #1
0
ファイル: test_data.py プロジェクト: genialis/resolwe-bio-py
    def test_children(self):
        # Data with no id should fail.
        data = Data(id=None, resolwe=MagicMock())
        with self.assertRaisesRegex(ValueError, 'Instance must be saved *'):
            data.children  # pylint: disable=pointless-statement

        # Core functionality should be checked with e2e tests.

        # Check that cache is cleared at update.
        data = Data(id=42, resolwe=MagicMock())
        data._children = 'foo'
        data.update()
        self.assertEqual(data._children, None)
コード例 #2
0
ファイル: test_data.py プロジェクト: romunov/resolwe-bio-py
    def test_children(self):
        # Data with no id should fail.
        data = Data(id=None, resolwe=MagicMock())
        with self.assertRaisesRegex(ValueError, 'Instance must be saved *'):
            data.children  # pylint: disable=pointless-statement

        # Core functionality should be checked with e2e tests.

        # Check that cache is cleared at update.
        data = Data(id=42, resolwe=MagicMock())
        data._children = 'foo'
        data.update()
        self.assertEqual(data._children, None)
コード例 #3
0
    def test_children(self):
        # Data with no id should fail.
        data = Data(id=None, resolwe=MagicMock())
        with self.assertRaisesRegex(ValueError, "Instance must be saved *"):
            data.children

        # Core functionality should be checked with e2e tests.

        # Check that cache is cleared at update.
        data = Data(id=42, resolwe=MagicMock())
        data._children = "foo"
        data.update()
        self.assertEqual(data._children, None)