Skip to content

Commit

Permalink
Prepare rosie for the new serenata-toolbox structure
Browse files Browse the repository at this point in the history
  • Loading branch information
anaschwendler committed May 4, 2017
1 parent 2558920 commit fb91f0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions rosie/chamber_of_deputies/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pandas as pd
from serenata_toolbox.ceap_dataset import CEAPDataset
from serenata_toolbox.chamber_of_deputies.chamber_of_deputies_dataset import ChamberOfDeputiesDataset
from serenata_toolbox.datasets import fetch


Expand Down Expand Up @@ -56,11 +56,11 @@ def rename_categories(self):

def update_datasets(self):
os.makedirs(self.path, exist_ok=True)
ceap = CEAPDataset(self.path)
ceap.fetch()
ceap.convert_to_csv()
ceap.translate()
ceap.clean()
chamber_of_deputies = ChamberOfDeputiesDataset(self.path)
chamber_of_deputies.fetch()
chamber_of_deputies.convert_to_csv()
chamber_of_deputies.translate()
chamber_of_deputies.clean()
fetch(self.COMPANIES_DATASET, self.path)

def get_reimbursements(self):
Expand Down
8 changes: 4 additions & 4 deletions rosie/chamber_of_deputies/tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def setUp(self):
def tearDown(self):
shutil.rmtree(self.temp_path)

@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.ChamberOfDeputiesDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, fetch, ceap):
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, fetch, chamber_of_deputies):
self.assertEqual(6, len(self.subject.dataset))
self.assertEqual(1, self.subject.dataset['legal_entity'].isnull().sum())

@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.ChamberOfDeputiesDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_prepare_dataset(self, fetch, ceap):
def test_prepare_dataset(self, fetch, chamber_of_deputies):
"""
* Rename columns.
* Make `document_type` a category column.
Expand Down

0 comments on commit fb91f0e

Please sign in to comment.