예제 #1
0
def test_lack_of_radius_with_hartigan_raises_error():
    """
    Test whether not passing a radius raises when choosing `hartigan` as a method raises an error
    """
    with pytest.raises(ValueError):
        subscriber_location_cluster(method="hartigan",
                                    start="2016-01-01",
                                    stop="2016-01-04")
예제 #2
0
def test_unlisted_methods_raises_error():
    """
    Test whether unlisted methods raise error
    """
    with pytest.raises(ValueError):
        subscriber_location_cluster(method="not_listed",
                                    start="2016-01-01",
                                    stop="2016-01-04")
예제 #3
0
def test_bad_subscriber_identifier_raises_error():
    """
    Test that passing an invalid subscriber_identifier raises an error.
    """
    with pytest.raises(ValueError):
        subscriber_location_cluster(
            method="hartigan",
            start="2016-01-01",
            stop="2016-01-04",
            radius=1,
            subscriber_identifier="BAD_SUBSCRIBER_ID",
        )
예제 #4
0
def test_subscriber_location_clusters_defaults():
    """Test that minimal call to subscriber_location_cluster creates expected object."""
    clus = subscriber_location_cluster(method="hartigan",
                                       start="2016-01-01",
                                       stop="2016-01-04",
                                       radius=1)
    assert 0 == clus.buffer
    assert 0 == clus.call_threshold