Skip to content
This repository has been archived by the owner on Mar 1, 2018. It is now read-only.

Commit

Permalink
adds fixture and first test for monthly subquota classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jtemporal committed Jan 19, 2017
1 parent df3b969 commit 913c911
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/fixtures/monthly_subquota_limit_classifier.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
applicant_id,document_id,issue_date,year,month,subquota_number,total_net_value
1,100,2015-03-01,2015,3,120,10500
1,100,2015-03-01,2015,3,120,401
2,100,2015-04-01,2015,4,120,10500
2,100,2015-04-01,2015,4,120,399
3,100,2015-05-01,2015,5,120,10500
3,100,2015-05-01,2015,5,120,400
4,100,2015-06-01,2015,6,120,10500
4,100,2015-06-01,2015,6,120,401
5,100,2015-06-01,2015,6,120,10500
19 changes: 19 additions & 0 deletions tests/test_monthly_subquota_limit_classifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from unittest import TestCase

import numpy as np
import pandas as pd
from rosie.monthly_subquota_limit_classifier import MonthlySubquotaLimitClassifier


class TestMonthlySubquotaLimitClassifier(TestCase):

def setUp(self):
self.dataset = pd.read_csv('tests/fixtures/monthly_subquota_limit_classifier.csv',
dtype={'subquota_number': np.str})
self.subject = MonthlySubquotaLimitClassifier()
self.subject.fit_transform(self.dataset)
self.prediction = self.subject.predict(self.dataset)

def test_predict_false_when_not_in_date_range(self):
self.assertEqual(False, self.prediction[0])
self.assertEqual(False, self.prediction[1])

0 comments on commit 913c911

Please sign in to comment.