Ejemplo n.º 1
0
 def test_unparsed_nocheck_state_creation(self):
     nocheck_state = state.make_nocheck_state(parsed=False)
     expected_state = "{\"nocheck\": true}"
     self.assertEqual(str, type(nocheck_state))
     self.assertEqual(expected_state, nocheck_state)
     parsed_state = json.loads(nocheck_state)
     self.assertTrue(state.is_disabled(parsed_state))
Ejemplo n.º 2
0
 def test_unparsed_nocheck_state_creation(self):
     nocheck_state = state.make_nocheck_state(parsed=False)
     expected_state = "{\"nocheck\": true}"
     self.assertEqual(str, type(nocheck_state))
     self.assertEqual(expected_state, nocheck_state)
     parsed_state = json.loads(nocheck_state)
     self.assertTrue(state.is_disabled(parsed_state))
Ejemplo n.º 3
0
    def test_check_disabling(self):
        no_check_state = {"nocheck": True}
        s = state.parse_state(json.dumps(no_check_state))
        self.assertEqual(s, no_check_state)
        self.assertTrue(state.is_disabled(s))

        s2 = state.make_nocheck_state(parsed=True)
        self.assertEqual(s, s2)

        s3 = state.make_nocheck_state(parsed=False)
        self.assertEqual(json.dumps(no_check_state), s3)
Ejemplo n.º 4
0
    def test_check_disabling(self):
        no_check_state = {
            "nocheck": True
        }
        s = state.parse_state(json.dumps(no_check_state))
        self.assertEqual(s, no_check_state)
        self.assertTrue(state.is_disabled(s))

        s2 = state.make_nocheck_state(parsed=True)
        self.assertEqual(s, s2)

        s3 = state.make_nocheck_state(parsed=False)
        self.assertEqual(json.dumps(no_check_state), s3)
Ejemplo n.º 5
0
 def test_parsed_nocheck_state_creation(self):
     nocheck_state = state.make_nocheck_state(parsed=True)
     expected_state = {'nocheck': True}
     self.assertEqual(dict, type(nocheck_state))
     self.assertEqual(expected_state, nocheck_state)
     self.assertTrue(state.is_disabled(nocheck_state))
Ejemplo n.º 6
0
 def test_parsed_nocheck_state_creation(self):
     nocheck_state = state.make_nocheck_state(parsed=True)
     expected_state = {'nocheck': True }
     self.assertEqual(dict, type(nocheck_state))
     self.assertEqual(expected_state, nocheck_state)
     self.assertTrue(state.is_disabled(nocheck_state))