コード例 #1
0
    def test_is_valid_json_with_none(self):
        # Assure
        tested_value = None

        # Act
        result = nns_converters.is_valid_json(tested_value)

        # Assert
        self.assertFalse(result)
コード例 #2
0
    def test_is_valid_json_with_valid_json(self):
        # Assure
        tested_value = '{"code": "valid"}'

        # Act
        result = nns_converters.is_valid_json(tested_value)

        # Assert
        self.assertTrue(result)
コード例 #3
0
    def test_is_valid_json_with_empty_json(self):
        # Assure
        tested_value = '{}'

        # Act
        result = nns_converters.is_valid_json(tested_value)

        # Assert
        self.assertFalse(result)