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))
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)
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)
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))
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))