Beispiel #1
0
    def test_build_relation_builds_correct_relation_with_urn_value(self):
        virkning = "VIRKNING"
        objekttype = "OBJEKTTYPE"

        value = "urn:urnvalue"

        expected_relation = {
            'virkning': virkning,
            'objekttype': objekttype,
            'urn': value
        }

        actual_relation = br.build_relation(value=value, virkning=virkning,
                                            objekttype=objekttype)

        self.assertEqual(expected_relation, actual_relation)
Beispiel #2
0
    def test_build_relation_builds_correct_relation_with_uuid_value(self):
        virkning = "VIRKNING"
        objekttype = "OBJEKTTYPE"

        value = "e16f42c5-cd64-411d-827a-15c9198e932d"

        expected_relation = {
            'virkning': virkning,
            'objekttype': objekttype,
            'uuid': value
        }

        actual_relation = br.build_relation(value=value, virkning=virkning,
                                            objekttype=objekttype)

        self.assertEqual(expected_relation, actual_relation)
Beispiel #3
0
    def test_build_relation_raises_ValueError_on_non_uuid_or_non_urn_value(
            self):
        value = "not urn or uuid"

        with self.assertRaises(ValueError):
            br.build_relation(value)