Beispiel #1
0
    def test_endpoint_relation(self):
        r = _SourceResult(self.fields,
                          sentinel.xivo_id,
                          endpoint_id=sentinel.endpoint_id)

        assert_that(
            r.relations,
            equal_to({
                'xivo_id': sentinel.xivo_id,
                'agent_id': None,
                'user_id': None,
                'user_uuid': None,
                'endpoint_id': sentinel.endpoint_id,
                'source_entry_id': None
            }))
Beispiel #2
0
    def test_fields(self):
        r = _SourceResult(self.fields, self.xivo_id)

        assert_that(r.fields, equal_to(self.fields))
        assert_that(r.relations, equal_to(self.empty_relations))
Beispiel #3
0
    def test_source(self):
        r = _SourceResult(self.fields, self.xivo_id)
        r.source = sentinel.source

        assert_that(r.source, equal_to(sentinel.source))
Beispiel #4
0
    def test_get_unique(self):
        r = _SourceResult(self.fields)
        r._unique_column = 'client_no'

        assert_that(r.get_unique(), equal_to('1'))