id int64 0 1.29M | original_id stringlengths 32 32 | swhid stringlengths 100 170 | sha1 stringlengths 40 40 | repo_name stringlengths 2 45 | repo_group stringclasses 12
values | filepath stringlengths 5 153 | name stringlengths 1 14.9k | type stringclasses 3
values | code stringlengths 7 2.12M |
|---|---|---|---|---|---|---|---|---|---|
300 | 7cbddbd25c38b6e30769f19611330598 | swh:1:cnt:34ba5b9d4206a28c26ebd3ac1c102301171ff314;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=243-248/ | 114320a6bc94975e7bd56f4f8b386eaaf2f595cd | aggregator | analytics | tests/test_util.py | UtilTestCase::test_update_csv_data_dict_two_columns(self) | function | def test_update_csv_data_dict_two_columns(self):
csv_data = {}
actual = aggregator.update_csv_data_dict(csv_data, '2014-06-12', '47')
self.assertEqual(actual, {
'2014-06-12': '2014-06-12,47'
}) |
301 | c62ac5b8c6fe1ea06a5a80ddf9e7d361 | swh:1:cnt:34ba5b9d4206a28c26ebd3ac1c102301171ff314;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=250-256/ | 114320a6bc94975e7bd56f4f8b386eaaf2f595cd | aggregator | analytics | tests/test_util.py | UtilTestCase::test_update_csv_data_dict_three_columns(self) | function | def test_update_csv_data_dict_three_columns(self):
csv_data = {}
actual = aggregator.update_csv_data_dict(csv_data, '2014-06-12', '47',
'4711')
self.assertEqual(actual, {
'2014-06-12': '2014-06-12,47,4711'
}) |
302 | 062f19d679fa72f0a0ca1496f4cafdef | swh:1:cnt:34ba5b9d4206a28c26ebd3ac1c102301171ff314;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=447-456/ | 114320a6bc94975e7bd56f4f8b386eaaf2f595cd | aggregator | analytics | tests/test_util.py | FileSystemUtilTestCase::test_merge_sum_csv_data_dict_with_wrong_value(self) | function | def test_merge_sum_csv_data_dict_with_wrong_value(self):
dict_1 = {}
dict_2 = {
'2014-01-01': 'wrong value',
}
nose.tools.assert_raises(
ValueError,
aggregator.merge_sum_csv_data_dict,
dict_1,
dict_2) |
303 | d43dbf12e9f868517828f713640459e2 | swh:1:cnt:34ba5b9d4206a28c26ebd3ac1c102301171ff314;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=458-467/ | 114320a6bc94975e7bd56f4f8b386eaaf2f595cd | aggregator | analytics | tests/test_util.py | FileSystemUtilTestCase::test_merge_sum_csv_data_dict_with_non_integers(self) | function | def test_merge_sum_csv_data_dict_with_non_integers(self):
dict_1 = {}
dict_2 = {
'2014-01-01': '2014-01-01,not,an,integer,value',
}
nose.tools.assert_raises(
ValueError,
aggregator.merge_sum_csv_data_dict,
dict_1,
dict_2) |
304 | eb06a7cb65120996182e29c5be55fc5a | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=33-91/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase | type | class ProjectcountsTestCase(unittest.TestCase):
def get_fixture_dir_abs(self, fixture_name):
return os.path.join(FIXTURES_DIR_ABS, fixture_name)
def create_tmp_dir_abs(self):
# Since we have to have the file visible in the file system, we cannot
# use *TemporaryFile, and have to resort ... |
305 | a1b1ba9a6b4c09792dd8eba1aae3fe90 | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=94-115/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsDataTestCase | type | class ProjectcountsDataTestCase(ProjectcountsTestCase):
def setUp(self):
super(ProjectcountsDataTestCase, self).setUp()
self.data_dir_abs = self.create_tmp_dir_abs()
self.daily_raw_dir_abs = os.path.join(self.data_dir_abs, 'daily_raw')
os.mkdir(self.daily_raw_dir_abs)
self.... |
306 | ecc510712bef756fdd9713972db793f2 | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=34-35/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::get_fixture_dir_abs(self, fixture_name) | function | def get_fixture_dir_abs(self, fixture_name):
return os.path.join(FIXTURES_DIR_ABS, fixture_name) |
307 | 50aab4b55a4bc463f71d2277e4d3108b | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=52-53/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::create_empty_file(self, file_abs) | function | def create_empty_file(self, file_abs):
open(os.path.join(file_abs), 'w').close() |
308 | c9ec262e750ee7fd6c984a6c8e3bb83c | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=60-76/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::assert_file_content_equals(self, actual_file_abs, expected_lines) | function | def assert_file_content_equals(self, actual_file_abs, expected_lines):
header = 'Date,Total,Desktop site,Mobile site,Zero site'
expected_lines.insert(0, header)
with open(actual_file_abs, 'r') as file:
for expected_line in expected_lines:
try:
self... |
309 | 6f7382c1d44ba953726868a0ee5a1e6c | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=95-115/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsDataTestCase::setUp(self) | function | def setUp(self):
super(ProjectcountsDataTestCase, self).setUp()
self.data_dir_abs = self.create_tmp_dir_abs()
self.daily_raw_dir_abs = os.path.join(self.data_dir_abs, 'daily_raw')
os.mkdir(self.daily_raw_dir_abs)
self.daily_dir_abs = os.path.join(self.data_dir_abs, 'daily')
... |
310 | 9d77a12678c80d1e1f29ffc2ebbc290c | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=55-58/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::create_file(self, file_abs, lines) | function | def create_file(self, file_abs, lines):
with open(file_abs, 'w') as file:
for line in lines:
file.write(line + aggregator.CSV_LINE_ENDING) |
311 | b11c17eb9e2618ecbf60dfaf0d41c156 | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=37-50/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::create_tmp_dir_abs(self) | function | def create_tmp_dir_abs(self):
# Since we have to have the file visible in the file system, we cannot
# use *TemporaryFile, and have to resort to mkdtemp
tmp_dir_abs = tempfile.mkdtemp(prefix='test_projectcounts')
logging.error("Creating tmp directory '%s'" % (
tmp_dir_abs))
... |
312 | 089c3a12b0ca6131a964e1ada97a612b | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=78-80/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::setUp(self) | function | def setUp(self):
super(ProjectcountsTestCase, self).setUp()
aggregator.clear_cache() |
313 | c0dbfbf990a7d6d1aed0bc16f2b8fde9 | swh:1:cnt:81b665feb16a9e36ceeed6d7a199c706726557c4;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=82-91/ | ef4d289290e6d96b53ec77b73820d7c266f492ba | aggregator | analytics | tests/test_projectcounts/testcases.py | ProjectcountsTestCase::tearDown(self) | function | def tearDown(self):
try:
for tmp_dir_abs in self.tmp_dirs_abs:
logging.error("Cleaning up tmp directory '%s'" % (
tmp_dir_abs))
shutil.rmtree(tmp_dir_abs)
except AttributeError:
pass
finally:
super(Projectcou... |
314 | c2817b86e01b8f9015bd770b5175baba | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=31-302/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase | type | class DailyProjectAggregationTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for 'daily' project aggregation functions"""
def test_daily_csv_non_existing_csv_empty_data(self):
date = datetime.date(2014, 7, 4)
csv_data = {}
nose.tools.assert_raises(
RuntimeError,
... |
315 | 616f39447a0278b97bb0f95083a8706a | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=98-113/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_existing_csv_existing_data_without_force(self) | function | def test_daily_csv_existing_csv_existing_data_without_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-16,47,500'
])
date = datetime.date(2014, 5, 16)
csv_data = {'2014-05-16': '2014-05-16... |
316 | fe46e050abef287cd853c8b419544bd4 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=61-82/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_non_existing_csv_existing_data_multiple(self) | function | def test_daily_csv_non_existing_csv_existing_data_multiple(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
first_date = datetime.date(2014, 5, 13)
last_date = datetime.date(2014, 5, 15)
csv_data = {
'2014-05-12': '2014-05-12,1,2,3',
'2014... |
317 | 5969d99ce5a4509c62ae9f735876c9c7 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=132-163/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_existing_csv_existing_data_multiple_with_force(self) | function | def test_daily_csv_existing_csv_existing_data_multiple_with_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-12,47,501',
'2014-05-13,47,502',
'2014-05-14,47,503',
'2014-05-15,47,504'... |
318 | d43630a6bc286bba6c0d2d800ae5f36b | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=200-234/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_bad_dates_outside_data_with_force(self) | function | def test_daily_csv_bad_dates_outside_data_with_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-12,47,501',
'2014-05-13,47,502',
'2014-05-14,47,503',
'2014-05-15,47,504',
... |
319 | f3bccac3557bc15fa7341c0381942152 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=33-45/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_non_existing_csv_empty_data(self) | function | def test_daily_csv_non_existing_csv_empty_data(self):
date = datetime.date(2014, 7, 4)
csv_data = {}
nose.tools.assert_raises(
RuntimeError,
aggregator.update_daily_csv,
self.data_dir_abs,
'enwiki',
csv_data,
date,
... |
320 | 66d06dbfbc24990efef0b4a866ffedcc | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=84-96/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_non_existing_csv_existing_data_outside_date(self) | function | def test_daily_csv_non_existing_csv_existing_data_outside_date(self):
date = datetime.date(2014, 5, 17)
csv_data = {'2014-05-16': '2014-05-16,1,2,3'}
nose.tools.assert_raises(
RuntimeError,
aggregator.update_daily_csv,
self.data_dir_abs,
'enwiki'... |
321 | cc676552f40d5134a8c535083f702940 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=47-59/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_non_existing_csv_existing_data_single(self) | function | def test_daily_csv_non_existing_csv_existing_data_single(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
date = datetime.date(2014, 5, 16)
csv_data = {'2014-05-16': '2014-05-16,1,2,3'}
aggregator.update_daily_csv(self.data_dir_abs, 'enwiki', csv_data,
... |
322 | c28446693cf1bad2f1c3066428a81901 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=115-130/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_existing_csv_existing_data_with_force(self) | function | def test_daily_csv_existing_csv_existing_data_with_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-16,47,500'
])
date = datetime.date(2014, 5, 16)
csv_data = {'2014-05-16': '2014-05-16,47... |
323 | 6ad64e1d1022cfc3ad5f6a371c1bb36b | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=165-198/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_bad_dates_outside_data_without_force(self) | function | def test_daily_csv_bad_dates_outside_data_without_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-12,47,501',
'2014-05-13,47,502',
'2014-05-14,47,503',
'2014-05-15,47,504',
... |
324 | 7c146cbdaee0e30da3d2d102b1412549 | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=236-267/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_bad_dates_without_force(self) | function | def test_daily_csv_bad_dates_without_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-12,47,501',
'2014-05-13,47,502',
'2014-05-15,47,504',
'2014-05-16,47,505',
])
... |
325 | 04d78bfa88b488a5e98da5a355f199ca | swh:1:cnt:cb332765ed4fcac52c646f8579273405ed530c42;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=269-302/ | 69c9ec150a3b3205b258c9d98230930c0fa4434b | aggregator | analytics | tests/test_projectcounts/test_daily_aggregation.py | DailyProjectAggregationTestCase::test_daily_csv_bad_dates_with_force(self) | function | def test_daily_csv_bad_dates_with_force(self):
enwiki_file_abs = os.path.join(self.daily_dir_abs, 'enwiki.csv')
self.create_file(enwiki_file_abs, [
'2014-05-12,47,501',
'2014-05-13,47,502',
'2014-05-15,47,504',
'2014-05-16,47,505',
])
... |
326 | eb1845e5f64373962e0689d96dd94c77 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=29-687/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase | type | class BasicTestCase(testcases.ProjectcountsTestCase):
"""TestCase for helper functions"""
def test_aggregate_for_date_missing_hours_2014_11_01(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
nose.tools.assert_raises(RuntimeError,
... |
327 | 8f3ff3be349c7f64d4204d1bdd850ae9 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=55-62/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_01_no_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_01_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date,
... |
328 | 25fbc5a77e924da4e9ca62204232954c | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=117-128/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_03_allow_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_03_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
actual = aggregator.aggregate_for_date(fixture, date,
allow_bad_data=True)
... |
329 | 053bf658e3b45c2aa669d59ee0439968 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=169-181/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_enwiki_different_per_day_3(self) | function | def test_aggregate_for_date_enwiki_different_per_day_3(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 3)
actual = aggregator.aggregate_for_date(fixture, date)
# Each hour is 1000 + the hour itself, ... |
330 | 0351aa3d4c0d7bcd3da62eea03427a1e | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=230-237/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_01(self) | function | def test_get_daily_count_missing_hours_2014_11_01(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
fixture, '... |
331 | 06fb0b2fbc613474dc3df925bb4d6226 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=496-522/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days_bad_dates_skew(self) | function | def test_rescale_counts_more_days_bad_dates_skew(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,1000... |
332 | 2691910818dcc36519bc5a604c27028c | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=580-603/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_zero_and_empty_columns(self) | function | def test_rescale_counts_zero_and_empty_columns(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,100',
'2014-08-04': '2014-08-04,18,0,3,5,0,7,... |
333 | 7bbc95a634832770531d29773aa9484e | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=64-71/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_02_no_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_02_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date,
... |
334 | 3f6cdc6e5e7e901c48066bc0fccab6d6 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=130-139/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_04_allow_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_04_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 4)
actual = aggregator.aggregate_for_date(fixture, date,
allow_bad_data=True)
... |
335 | 58acbf9dd8912b3cd4d9c2e044fb10a8 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=183-192/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_different_wiki(self) | function | def test_aggregate_for_date_different_wiki(self):
fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
date = datetime.date(2014, 11, 1)
actual = aggregator.aggregate_for_date(fixture, date)
expected = {'en': 1, 'de': 26, 'fr': 8}
self.assertEquals(actual, expected) |
336 | 6618d49e0a783f60e17aa2bce6c59959 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=239-246/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_02(self) | function | def test_get_daily_count_missing_hours_2014_11_02(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
fixture, '... |
337 | a1ef7c7d5e21b57924189337e8304f54 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=524-547/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_only_bad_dates(self) | function | def test_rescale_counts_only_bad_dates(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1000,100,10',
... |
338 | bff7a2aa100c08e18e477d307e1f8e04 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=605-628/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_zero_and_empty_columns_upscale(self) | function | def test_rescale_counts_zero_and_empty_columns_upscale(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,100',
'2014-08-04': '2014-08-04,18,0,... |
339 | 2216cbc5276b4dcfc807032c868555f6 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=349-364/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_single_day(self) | function | def test_rescale_counts_single_day(self):
dates = [datetime.date(2014, 8, 3)]
csv_data = {
'2014-08-03': '2014-08-03,3,2,1'
}
bad_dates = []
actual = aggregator.rescale_counts(
csv_data,
dates,
bad_dates,
1)
... |
340 | 31bced68c5c2e8481113d28b84dfac51 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=549-561/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_no_data(self) | function | def test_rescale_counts_no_data(self):
dates = [datetime.date(2014, 8, 4)]
csv_data = {}
bad_dates = []
nose.tools.assert_raises(RuntimeError,
aggregator.rescale_counts,
csv_data,
dates,... |
341 | 74be7af3299506f30b6757915c0de337 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=630-653/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_shorter_second_column(self) | function | def test_rescale_counts_shorter_second_column(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,100,200',
'2014-08-04': '2014-08-04,3,1,2',
... |
342 | 5ab693ce983d2d4802dbd371f7a008ef | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=366-389/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days(self) | function | def test_rescale_counts_more_days(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,1000,100,10',
... |
343 | e699ee49813db3069611ecdb36e625dd | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=563-578/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_no_data_for_date(self) | function | def test_rescale_counts_no_data_for_date(self):
dates = [datetime.date(2014, 8, 4)]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-05': '2014-08-05,2000,200,20',
}
bad_dates = []
nose.tools.assert_raises(RuntimeError,
... |
344 | 77ecc249c8577503176afd9e37d867e3 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=655-670/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_override_total_column(self) | function | def test_rescale_override_total_column(self):
dates = [datetime.date(2014, 8, 3)]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3'
}
bad_dates = []
actual = aggregator.rescale_counts(
csv_data,
dates,
bad_dates,
1)
... |
345 | 78922790290e9b6a75b1437db9d0cd3c | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=672-687/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_wrong_lines_2014_11_01(self) | function | def test_get_daily_count_wrong_lines_2014_11_01(self):
fixture = self.get_fixture_dir_abs('2014-11-wrong-lines')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'en', date,
allow_bad_data=False)
# Each hour is ... |
346 | 81a8b29fc9edab03d35a560c2e5f47b3 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=39-45/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_02(self) | function | def test_aggregate_for_date_missing_hours_2014_11_02(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date, fixture, date) |
347 | 16048ae50ee33bae682acfbec7a813da | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=73-80/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_03_no_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_03_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date,
... |
348 | fa8c30a172e6c3546a05bf21bed1a2c8 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=91-102/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_01_allow_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_01_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
actual = aggregator.aggregate_for_date(fixture, date,
allow_bad_data=True)
... |
349 | 0f2b9dc72e72f306a804c585fd5ff818 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=141-153/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_enwiki_different_per_day_1(self) | function | def test_aggregate_for_date_enwiki_different_per_day_1(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 1)
actual = aggregator.aggregate_for_date(fixture, date)
# Each hour is 1000 + the hour itself, ... |
350 | da0c416cee67372e310d41bc4ef4f5e7 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=194-201/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_en(self) | function | def test_get_daily_count_en(self):
fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'en', date)
self.assertEquals(actual, 1) |
351 | 0b7f191dca75f7735e3b45fd3cd18565 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=248-255/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_03(self) | function | def test_get_daily_count_missing_hours_2014_11_03(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
fixture, '... |
352 | ae36b125ebd835ed7e6fd58950c2bdcf | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=284-291/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_03_no_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_03_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
... |
353 | a143702a3743fb11189b67d1e0bdfcc2 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=326-336/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_03_allow_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_03_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
actual = aggregator.get_daily_count(fixture, 'en', date,
allow_bad_data=True)
... |
354 | d0c35fa7f63799b8e495c95f1b39f221 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=47-53/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_03(self) | function | def test_aggregate_for_date_missing_hours_2014_11_03(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 3)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date, fixture, date) |
355 | 0ad1d820bb6357b793ceb3449061288d | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=82-89/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_04_no_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_04_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 4)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date,
... |
356 | a7d8f480de1739a58a1abaadba24e8e6 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=104-115/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_02_allow_bad_data(self) | function | def test_aggregate_for_date_missing_hours_2014_11_02_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
actual = aggregator.aggregate_for_date(fixture, date,
allow_bad_data=True)
... |
357 | e5a83dea2788ad4d335a4465d0f7c3f3 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=155-167/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_enwiki_different_per_day_2(self) | function | def test_aggregate_for_date_enwiki_different_per_day_2(self):
fixture = self.get_fixture_dir_abs(
'2014-11-3days-enwiki-day-times-100-plus-hour')
date = datetime.date(2014, 11, 2)
actual = aggregator.aggregate_for_date(fixture, date)
# Each hour is 1000 + the hour itself, ... |
358 | 15b4ba6a8a7c9ef152d313adc6bddd45 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=203-210/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_de(self) | function | def test_get_daily_count_de(self):
fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'de', date)
self.assertEquals(actual, 26) |
359 | 5d459e18a89f9eac31a7b24c15c23dc4 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=257-264/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_04(self) | function | def test_get_daily_count_missing_hours_2014_11_04(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 4)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
fixture, '... |
360 | 7a350da48fee80f5237aae103406f72c | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=293-300/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_04_no_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_04_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 4)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
... |
361 | 8ae2afb56d00e822426643a46b68491b | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=338-347/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_04_allow_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_04_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 4)
actual = aggregator.get_daily_count(fixture, 'en', date,
allow_bad_data=True)
... |
362 | 6665db61390ac04fb5551eb62f881b44 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=212-219/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_fr(self) | function | def test_get_daily_count_fr(self):
fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'fr', date)
self.assertEquals(actual, 8) |
363 | 34f7bedc33b4d04f3795eda65ad32c88 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=266-273/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_01_no_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_01_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
... |
364 | d361299d38b625b888b959b8389c9547 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=302-312/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_01_allow_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_01_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'en', date,
allow_bad_data=True)
... |
365 | 68b5782cd1c6ad4f3103c4b5e060b3f5 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=391-414/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days_downscale_int(self) | function | def test_rescale_counts_more_days_downscale_int(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,1000,... |
366 | dd47d29473af3a6d7c8d866e5d47ed25 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=441-466/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days_bad_dates_middle(self) | function | def test_rescale_counts_more_days_bad_dates_middle(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,10... |
367 | a72240b082f1c884c499a22ce01d0b73 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=31-37/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_aggregate_for_date_missing_hours_2014_11_01(self) | function | def test_aggregate_for_date_missing_hours_2014_11_01(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 1)
nose.tools.assert_raises(RuntimeError,
aggregator.aggregate_for_date, fixture, date) |
368 | d06c81a781d2ebdad5145451777ce703 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=221-228/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_empty_abbreviation(self) | function | def test_get_daily_count_empty_abbreviation(self):
fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
date = datetime.date(2014, 11, 1)
actual = aggregator.get_daily_count(fixture, 'foo', date)
self.assertEquals(actual, 0) |
369 | fa8a321200bc56741104972af46570dd | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=275-282/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_02_no_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_02_no_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
nose.tools.assert_raises(RuntimeError,
aggregator.get_daily_count,
... |
370 | 60c746225e7d7853e81942c8f71234c2 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=314-324/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_get_daily_count_missing_hours_2014_11_02_allow_bad_data(self) | function | def test_get_daily_count_missing_hours_2014_11_02_allow_bad_data(self):
fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
date = datetime.date(2014, 11, 2)
actual = aggregator.get_daily_count(fixture, 'en', date,
allow_bad_data=True)
... |
371 | 58456fd6a792af87fb93a3631cbc350b | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=416-439/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days_upscale(self) | function | def test_rescale_counts_more_days_upscale(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,1000,100,10... |
372 | d3d32050397f658a0f59c41debda0989 | swh:1:cnt:ef4bf563a24c34e091d831f5cf47143fd9e5016f;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=468-494/ | 4be47108507948de9f7dd32174a36893347f69bc | aggregator | analytics | tests/test_projectcounts/test_helpers.py | BasicTestCase::test_rescale_counts_more_days_bad_dates_borders(self) | function | def test_rescale_counts_more_days_bad_dates_borders(self):
dates = [
datetime.date(2014, 8, 4),
datetime.date(2014, 8, 5),
datetime.date(2014, 8, 6),
]
csv_data = {
'2014-08-03': '2014-08-03,1,2,3',
'2014-08-04': '2014-08-04,1110,1... |
373 | 5ac6bf2e1409de0a50de37b569a360e1 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=32-258/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase | type | class MonitoringTestCase(testcases.ProjectcountsDataTestCase):
"""TestCase for monitoring functions"""
def setUp(self):
super(MonitoringTestCase, self).setUp()
self.csv_dir_abs = self.data_dir_abs
def get_relevant_daily_date_strs(self):
today = datetime.date.today()
for day... |
374 | d86d8e3048df4187b2c9e6b7bb81fce5 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=276-283/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | WeeklyMonitoringTestCase | type | class WeeklyMonitoringTestCase(DailyRawMonitoringTestCase):
def setUp(self):
super(WeeklyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.weekly_dir_abs
def get_relevant_date_strs(self):
for date_str in self.get_relevant_weekly_date_strs():
yield date_str |
375 | b3b6688ea55bcec1f50250bce9fcc745 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=262-265/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | DailyRawMonitoringTestCase | type | class DailyRawMonitoringTestCase(MonitoringTestCase):
def setUp(self):
super(DailyRawMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.daily_raw_dir_abs |
376 | 6c1306c4019ae71f9e39ec25a0274a09 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=269-272/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | DailyMonitoringTestCase | type | class DailyMonitoringTestCase(DailyRawMonitoringTestCase):
def setUp(self):
super(DailyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.daily_dir_abs |
377 | 121d87df0da8e3a58b74a2e32e7f607f | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=287-294/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonthlyMonitoringTestCase | type | class MonthlyMonitoringTestCase(DailyRawMonitoringTestCase):
def setUp(self):
super(MonthlyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.monthly_dir_abs
def get_relevant_date_strs(self):
for date_str in self.get_relevant_monthly_date_strs():
yield date_str |
378 | 560f75f922733f75d8ae75f7c721d621 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=298-305/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | YearlyMonitoringTestCase | type | class YearlyMonitoringTestCase(DailyRawMonitoringTestCase):
def setUp(self):
super(YearlyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.yearly_dir_abs
def get_relevant_date_strs(self):
for date_str in self.get_relevant_yearly_date_strs():
yield date_str |
379 | 01831a29020f7af39200c50da725d109 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=69-71/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::get_relevant_date_strs(self) | function | def get_relevant_date_strs(self):
for date_str in self.get_relevant_daily_date_strs():
yield date_str |
380 | 03475ce5c3c2c8a87e873719f77d128a | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=179-194/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_no_current(self) | function | def test_validity_enwiki_no_current(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
lines = []
for date_str in self.get_relevant_date_strs():
lines.append('%s,135925923,123456789,12345678,123456' % (date_str))
... |
381 | eb0c245bc060e93711a3b0bbcde84ab6 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=277-279/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | WeeklyMonitoringTestCase::setUp(self) | function | def setUp(self):
super(WeeklyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.weekly_dir_abs |
382 | 242f57ba843100f1a72673617a9cb2d7 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=299-301/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | YearlyMonitoringTestCase::setUp(self) | function | def setUp(self):
super(YearlyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.yearly_dir_abs |
383 | 5ac9363f83a0362775d693b9d7b77c9d | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=34-36/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::setUp(self) | function | def setUp(self):
super(MonitoringTestCase, self).setUp()
self.csv_dir_abs = self.data_dir_abs |
384 | 6209e412ee6a043aa5f72ed8d298eaf1 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=73-115/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::create_valid_aggregated_projects(self) | function | def create_valid_aggregated_projects(self):
for dbname in [
'enwiki',
'jawiki',
'dewiki',
'eswiki',
'frwiki',
'ruwiki',
'itwiki',
'foo',
]:
for dir_rel in ['daily_raw', 'daily']:
c... |
385 | 673b511eca014dbb57704d92013252f8 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=196-210/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_too_low_desktop(self) | function | def test_validity_enwiki_too_low_desktop(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
lines = []
for date_str in self.get_relevant_date_strs():
lines.append('%s,13580245,0,12345678,1234567' % (date_str))
... |
386 | 68d7f164d2f7c360e6fccdd504614842 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=281-283/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | WeeklyMonitoringTestCase::get_relevant_date_strs(self) | function | def get_relevant_date_strs(self):
for date_str in self.get_relevant_weekly_date_strs():
yield date_str |
387 | 75f36e3fc16f6720a4ca173713868a8c | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=303-305/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | YearlyMonitoringTestCase::get_relevant_date_strs(self) | function | def get_relevant_date_strs(self):
for date_str in self.get_relevant_yearly_date_strs():
yield date_str |
388 | bdb8bb22b42a830952bcdd8de824c8f0 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=158-169/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_empty(self) | function | def test_validity_enwiki_empty(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
self.create_empty_file(enwiki_file_abs)
issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
self.data_dir_abs)
... |
389 | 66340af8f81c5911f1a8bc916a9f4cf4 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=171-177/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_valid(self) | function | def test_validity_valid(self):
self.create_valid_aggregated_projects()
issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
self.data_dir_abs)
self.assertEquals(issues, []) |
390 | a51583f99db63e985faf9bc7f820ae75 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=244-258/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_total_does_not_add_up(self) | function | def test_validity_enwiki_total_does_not_add_up(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
lines = []
for date_str in self.get_relevant_date_strs():
lines.append('%s,200000000,123456789,12345678,123456' % (dat... |
391 | 423820c56bb11175fa3812aba6486a7e | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=38-44/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::get_relevant_daily_date_strs(self) | function | def get_relevant_daily_date_strs(self):
today = datetime.date.today()
for day_offset in range(-10, 0):
date = (today + datetime.timedelta(days=day_offset))
date_str = date.isoformat()
yield date_str |
392 | 649603a7e5256f6f36e86b721fa64a78 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=55-61/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::get_relevant_monthly_date_strs(self) | function | def get_relevant_monthly_date_strs(self):
today = datetime.date.today()
for day_offset in range(-90, 0):
date = (today + datetime.timedelta(days=day_offset))
if date.day == 1:
yield (date - datetime.timedelta(days=1)).strftime('%Y-%m') |
393 | b06012a8fc263e4fde485f4acd8652b9 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=212-226/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_too_low_mobile(self) | function | def test_validity_enwiki_too_low_mobile(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
lines = []
for date_str in self.get_relevant_date_strs():
lines.append('%s,124691356,123456789,0,1234567' % (date_str))
... |
394 | 967b00e6b273f314720d68dfd07af07b | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=263-265/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | DailyRawMonitoringTestCase::setUp(self) | function | def setUp(self):
super(DailyRawMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.daily_raw_dir_abs |
395 | aafc8f00c9fdb411c8f82d9a4744a900 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=270-272/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | DailyMonitoringTestCase::setUp(self) | function | def setUp(self):
super(DailyMonitoringTestCase, self).setUp()
self.csv_dir_abs = self.daily_dir_abs |
396 | bdf6c7c508c78da6bcb535776cc12d66 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=63-67/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::get_relevant_yearly_date_strs(self) | function | def get_relevant_yearly_date_strs(self):
today = datetime.date.today()
for year_offset in range(-3, 0):
yield str(today.year + year_offset) |
397 | 3038533285c159e255d1ad7477623c63 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=46-53/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::get_relevant_weekly_date_strs(self) | function | def get_relevant_weekly_date_strs(self):
today = datetime.date.today()
for day_offset in range(-30, 0):
date = (today + datetime.timedelta(days=day_offset))
if date.weekday() == 6:
date_str = date.strftime('%GW%V')
yield date_str |
398 | c6ca90b590f45f50318a447148e3f876 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=228-242/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::test_validity_enwiki_too_low_zero(self) | function | def test_validity_enwiki_too_low_zero(self):
self.create_valid_aggregated_projects()
enwiki_file_abs = os.path.join(self.csv_dir_abs, 'enwiki.csv')
lines = []
for date_str in self.get_relevant_date_strs():
lines.append('%s,135802467,123456789,12345678,0' % (date_str))
... |
399 | 7ea4ec8dc0145668773860278f3ccfd5 | swh:1:cnt:7c26506bf76c066e8463b3530f2dd0b010e92503;origin=https://gerrit.wikimedia.org/r/analytics/aggregator.git;lines=117-121/ | d8bd28caa96a8b4ab647d9ec4d5a7252ecb8aff9 | aggregator | analytics | tests/test_projectcounts/test_monitoring.py | MonitoringTestCase::assert_has_item_by_re(self, haystack, pattern) | function | def assert_has_item_by_re(self, haystack, pattern):
for straw in haystack:
if re.search(pattern, straw):
return
self.fail("Could not find '%s' in %s" % (pattern, haystack)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.