This repository has been archived by the owner on Mar 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure combining datasets return the same number of rows as reimburse…
…ments
- Loading branch information
Showing
4 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os.path | ||
from tempfile import mkdtemp | ||
from unittest import TestCase | ||
from unittest.mock import patch | ||
from shutil import copy2 | ||
|
||
from rosie import Dataset | ||
|
||
|
||
class TestDataset(TestCase): | ||
|
||
def setUp(self): | ||
temp_path = mkdtemp() | ||
copy2('tests/fixtures/companies.xz', | ||
os.path.join(temp_path, Dataset.COMPANIES_DATASET)) | ||
copy2('tests/fixtures/reimbursements.xz', temp_path) | ||
self.subject = Dataset(temp_path) | ||
|
||
@patch('rosie.dataset.CEAPDataset') | ||
@patch('rosie.dataset.fetch') | ||
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, _ceap_dataset, _fetch): | ||
dataset = self.subject.get() | ||
self.assertEqual(5, len(dataset)) | ||
self.assertEqual(1, dataset['legal_entity'].isnull().sum()) |