def test_datastore_related_to_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().related_to(
            obj="indicator--00000000-0000-4000-8000-000000000001",
            target_only=True,
        )
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)
예제 #2
0
def test_datastore_add_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().add(CAMPAIGN_MORE_KWARGS)
    assert "DataStoreMixin has no data sink to put objects in" == str(excinfo.value)
예제 #3
0
def test_datastore_creator_of_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().creator_of(CAMPAIGN_MORE_KWARGS)
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)
예제 #4
0
def test_datastore_query_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().query([Filter("type", "=", "indicator")])
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)
예제 #5
0
def test_datastore_all_versions_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().all_versions("indicator--00000000-0000-4000-8000-000000000001")
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)
예제 #6
0
def test_datastore_smoke():
    assert DataStoreMixin() is not None
예제 #7
0
def test_datastore_related_to_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().related_to(obj="indicator--d81f86b9-975b-bc0b-775e-810c5ad45a4f",
                                    target_only=True)
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)
예제 #8
0
def test_datastore_all_versions_raises():
    with pytest.raises(AttributeError) as excinfo:
        DataStoreMixin().all_versions("indicator--d81f86b9-975b-bc0b-775e-810c5ad45a4f")
    assert "DataStoreMixin has no data source to query" == str(excinfo.value)