import pytest

from innovation_networks.data_gathering.github import get_data


def test_make_url():
    """GitHub Archive URL creation works"""
    day = 6
    year = 1987
    month = 11
    hour = 8

    url = get_data.make_url(year=year,
                            month=month,
                            day=day,
                            hour=hour)
    test_url = "http://data.githubarchive.org/1987-11-06-08.json.gz"
    assert url == test_url

@@ -8,16 +8,57 @@
 pytest%0A%0A
+from datetime import datetime, timedelta%0A
 from inn
@@ -111,16 +111,22 @@
 get_data
+, urls
 %0A%0A%0Adef t
@@ -467,16 +467,16 @@
 son.gz%22%0A
-
     asse
@@ -494,8 +494,316 @@
 est_url%0A
+%0A%0Adef test_urls():%0A    %22%22%22Correct urls are returned for two year period%22%22%22%0A    urls_list = urls()%0A    test_url = (%22http://data.githubarchive.org/%7B%7D.json.gz%22%0A                .format((datetime.now() - timedelta(731)).strftime(%22%25Y-%25m-%25d%22)))%0A%0A    assert len(urls_list) == 731%0A    assert urls_list%5B0%5D == test_url%0A

Add test_urls