class test_unique_subscribers(TestCase):
    def setUp(self):

        self.UU = UniqueSubscribers("2016-01-01", "2016-01-02")

    def test_returns_set(self):
        """
        UniqueSubscribers() returns set.
        """
        self.assertIs(type(self.UU.as_set()), set)

    def test_subscribers_unique(self):
        """
        Returned dataframe has unique subscribers.
        """

        self.assertTrue(self.UU.get_dataframe()["subscriber"].is_unique)
    def test_subscribers_make_atleast_one_call_in_admin0(self):
        """
        The set of subscribers who make at least one call within admin0 over
        whole test time period should be equal to set of unique subscribers
        in test calls table.
        """

        start, stop = "2016-01-01", "2016-01-07"

        sls = SubscriberLocationSubset(start,
                                       stop,
                                       min_calls=1,
                                       level="admin0")
        us = UniqueSubscribers(start, stop, table="events.calls")

        sls_subs = set(sls.get_dataframe()["subscriber"])
        us_subs = set(us.get_dataframe()["subscriber"])

        self.assertEquals(sls_subs, us_subs)