コード例 #1
0
    def test_correct_node_state(self):
        s1 = {'edition_time': '2011-12-05T13:51:36.955Z'}
        ps1 = state.parse_state(json.dumps(s1))

        cursor = connection.cursor()
        checks1 = state.collect_state_checks(247, ps1, cursor, node=True)

        state.check_state(ps1, checks1, cursor)
コード例 #2
0
    def test_wrong_node_state(self):
        s1 = {'edition_time': '2016-03-15T03:37:56.217Z'}
        ps1 = state.parse_state(json.dumps(s1))

        cursor = connection.cursor()
        checks1 = state.collect_state_checks(247, ps1, cursor, node=True)
        self.assertEqual(len(checks1), 1)
        self.assertRaises(state.StateMatchingError,
                          lambda: state.check_state(ps1, checks1, cursor))

        s2 = {'edition_time': '2011-12-05T13:51:36.855Z'}
        ps2 = state.parse_state(json.dumps(s2))

        checks2 = state.collect_state_checks(247, ps2, cursor, node=True)
        self.assertEqual(len(checks2), 1)
        self.assertRaises(state.StateMatchingError,
                          lambda: state.check_state(ps2, checks2, cursor))
コード例 #3
0
ファイル: test_state_checks.py プロジェクト: catmaid/CATMAID
    def test_correct_node_state(self):
        s1 = {
            'edition_time': '2011-12-05T13:51:36.955Z'
        }
        ps1 = state.parse_state(json.dumps(s1))

        cursor = connection.cursor()
        checks1 = state.collect_state_checks(247, ps1, cursor, node=True)

        state.check_state(ps1, checks1, cursor)
コード例 #4
0
ファイル: test_state_checks.py プロジェクト: catmaid/CATMAID
    def test_wrong_node_state(self):
        s1 = {
            'edition_time': '2016-03-15T03:37:56.217Z'
        }
        ps1 = state.parse_state(json.dumps(s1))

        cursor = connection.cursor()
        checks1 = state.collect_state_checks(247, ps1, cursor, node=True)
        self.assertEqual(len(checks1), 1)
        self.assertRaises(state.StateMatchingError, lambda: state.check_state(ps1, checks1, cursor))

        s2 = {
            'edition_time': '2011-12-05T13:51:36.855Z'
        }
        ps2 = state.parse_state(json.dumps(s2))

        checks2 = state.collect_state_checks(247, ps2, cursor, node=True)
        self.assertEqual(len(checks2), 1)
        self.assertRaises(state.StateMatchingError, lambda: state.check_state(ps2, checks2, cursor))