|
5 | 5 | from process_report.tests import util as test_utils |
6 | 6 |
|
7 | 7 |
|
8 | | -class TestBUSubsidyProcessor(TestCase): |
9 | | - def test_get_bm_project_mask(self): |
10 | | - test_invoice = pandas.DataFrame({}) |
11 | | - |
12 | | - answer_invoice = test_invoice.iloc[[0, 2]] |
13 | | - |
14 | | - bm_usage_proc = test_utils.new_bm_usage_processor(data=test_invoice) |
15 | | - bm_project_mask = bm_usage_proc._get_bm_project_mask() |
16 | | - self.assertTrue(test_invoice[bm_project_mask].equals(answer_invoice)) |
17 | | - |
| 8 | +class TestBMUsageProcessor(TestCase): |
18 | 9 | def test_process_bm_usage(self): |
19 | 10 | test_invoice = pandas.DataFrame( |
20 | 11 | { |
21 | | - "Project - Allocation": ["test", "test bm-bm"], |
22 | | - "Project - Allocation ID": [None] * 2, |
23 | | - "Invoice Email": [None] * 2, |
| 12 | + "Project - Allocation": ["test", "test bm-bm", "not-bm"], |
| 13 | + "Project - Allocation ID": [None] * 3, |
| 14 | + "Invoice Email": [None] * 3, |
| 15 | + "Cluster Name": ["bm", "bm", "ocp"], |
24 | 16 | } |
25 | 17 | ) |
26 | 18 |
|
27 | 19 | answer_invoice = pandas.DataFrame( |
28 | 20 | { |
29 | | - "Project - Allocation": ["test BM Usage", "test bm-bm BM Usage"], |
30 | | - "Project - Allocation ID": ["ESI Bare Metal"] * 2, |
31 | | - "Invoice Email": ["nclinton@bu.edu"] * 2, |
| 21 | + "Project - Allocation": [ |
| 22 | + "test BM Usage", |
| 23 | + "test bm-bm BM Usage", |
| 24 | + "not-bm", |
| 25 | + ], |
| 26 | + "Project - Allocation ID": ["ESI Bare Metal"] * 2 + [None], |
| 27 | + "Invoice Email": ["nclinton@bu.edu"] * 2 + [None], |
| 28 | + "Cluster Name": ["bm", "bm", "ocp"], |
32 | 29 | } |
33 | 30 | ) |
34 | 31 |
|
35 | 32 | bm_usage_proc = test_utils.new_bm_usage_processor(data=test_invoice) |
36 | 33 | bm_usage_proc.process() |
| 34 | + answer_invoice = answer_invoice.astype(bm_usage_proc.data.dtypes) |
37 | 35 | self.assertTrue(bm_usage_proc.data.equals(answer_invoice)) |
0 commit comments