starting CountryCountsByClickedBatchcodeProviderTest

This commit is contained in:
frankknoll
2023-09-30 16:26:36 +02:00
parent 98f5e9762f
commit ca2fe187f9
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import unittest
from pandas.testing import assert_frame_equal
from TestHelper import TestHelper
import pandas as pd
from CountryCountsByClickedBatchcodeProvider import CountryCountsByClickedBatchcodeProvider
class CountryCountsByClickedBatchcodeProviderTest(unittest.TestCase):
def test_mergeCountryCountsByBatchcodeTables(self):
# Given
# When
countryCountsByClickedBatchcodeTable = CountryCountsByClickedBatchcodeProvider.getCountryCountsByClickedBatchcode('src/testdata/GoogleAnalytics/CountryByBatchcode 20230302-20230430.csv')
# Then
assert_frame_equal(
countryCountsByClickedBatchcodeTable,
TestHelper.createDataFrame(
columns = ['COUNTRY_COUNT_BY_VAX_LOT'],
data = [ [1],
[10],
[5]],
index = pd.MultiIndex.from_tuples(
names = ['VAX_LOT', 'COUNTRY'],
tuples = [['#012M20A', 'United States'],
['#EN6203', 'United States'],
['000006A', 'Japan']])))

View File

@@ -4,3 +4,8 @@
# 20230302-20230430 # 20230302-20230430
# ---------------------------------------- # ----------------------------------------
Clicked Batchcode,Country,Event count
,,15190,Grand total
#012M20A,United States,1
#EN6203,United States,10
000006A,Japan,5
1 # ----------------------------------------
4 # 20230302-20230430
5 # ----------------------------------------
6 Clicked Batchcode,Country,Event count
7 ,,15190,Grand total
8 #012M20A,United States,1
9 #EN6203,United States,10
10 000006A,Japan,5
11