示例#1
0
 def test_empty_cluster_type(self, biz_source):
     with pytest.raises(IntegrityError):
         factories.create_topic(
             topic_name='yelp.biz_test.1',
             namespace_name=biz_source.namespace.name,
             source_name=biz_source.name,
             cluster_type=None
         )
示例#2
0
 def test_valid_cluster_type(self, biz_source):
     cluster_type = 'scribe'
     topic = factories.create_topic(
         topic_name='yelp.biz_test.1',
         namespace_name=biz_source.namespace.name,
         source_name=biz_source.name,
         cluster_type=cluster_type)
     assert topic.cluster_type == cluster_type
示例#3
0
 def create_topic(self, topic_no):
     source_bar = factories.get_or_create_source(
         namespace_name='foo',
         source_name='bar',
         owner_email='*****@*****.**')
     return factories.create_topic(topic_name='topic_{}'.format(topic_no),
                                   namespace_name=source_bar.namespace.name,
                                   source_name=source_bar.name)
示例#4
0
 def test_valid_cluster_type(self, biz_source):
     cluster_type = 'scribe'
     topic = factories.create_topic(
         topic_name='yelp.biz_test.1',
         namespace_name=biz_source.namespace.name,
         source_name=biz_source.name,
         cluster_type=cluster_type
     )
     assert topic.cluster_type == cluster_type
示例#5
0
 def create_topic(self, topic_no):
     source_bar = factories.get_or_create_source(
         namespace_name='foo',
         source_name='bar',
         owner_email='*****@*****.**'
     )
     return factories.create_topic(
         topic_name='topic_{}'.format(topic_no),
         namespace_name=source_bar.namespace.name,
         source_name=source_bar.name
     )
示例#6
0
    def test_happy_case(self, mock_request, biz_source, biz_topic):
        # create another topic after biz_topic for the same source
        latest_topic = factories.create_topic(
            'new_topic',
            namespace_name=biz_source.namespace.name,
            source_name=biz_source.name)
        expected = self.get_expected_topic_resp(latest_topic.id)

        mock_request.matchdict = {'source_id': str(biz_source.id)}
        actual = source_views.get_latest_topic_by_source_id(mock_request)

        assert actual == expected
示例#7
0
 def topic(self):
     return factories.create_topic(
         factories.fake_topic_name,
         factories.fake_namespace,
         factories.fake_source,
     )
示例#8
0
 def test_empty_cluster_type(self, biz_source):
     with pytest.raises(IntegrityError):
         factories.create_topic(topic_name='yelp.biz_test.1',
                                namespace_name=biz_source.namespace.name,
                                source_name=biz_source.name,
                                cluster_type=None)
 def foo_topic(self, foo_source):
     return factories.create_topic(
         topic_name='foo',
         namespace_name=foo_source.namespace.name,
         source_name=foo_source.name
     )
示例#10
0
def biz_topic(biz_source):
    return factories.create_topic(
        topic_name='yelp.biz.1',
        namespace_name=biz_source.namespace.name,
        source_name=biz_source.name
    )
示例#11
0
def meta_attr_topic(meta_attr_source):
    return factories.create_topic(
        topic_name='yelp_meta.dummy_meta_attr.1',
        namespace_name=meta_attr_source.namespace.name,
        source_name=meta_attr_source.name
    )
 def foo_topic(self, foo_source):
     return factories.create_topic(topic_name='foo',
                                   namespace_name=foo_source.namespace.name,
                                   source_name=foo_source.name)
 def topic_of_src_two(self, source_two):
     return factories.create_topic(topic_name='another.topic.name',
                                   namespace_name=source_two.namespace.name,
                                   source_name=source_two.name)
 def topic_two(self, source_one):
     return factories.create_topic(topic_name='topic.2',
                                   namespace_name=source_one.namespace.name,
                                   source_name=source_one.name)
 def topic_one(self, source_one):
     return factories.create_topic(topic_name='some.topic',
                                   namespace_name=source_one.namespace.name,
                                   source_name=source_one.name)