from unittest import TestCase

import numpy as np
import pandas as pd

from rosie.chamber_of_deputies.classifiers import ElectionExpensesClassifier


class TestElectionExpensesClassifier(TestCase):

    def setUp(self):
        self.dataset = pd.read_csv('rosie/chamber_of_deputies/tests/fixtures/election_expenses_classifier.csv',
                                   dtype={'name': np.str, 'legal_entity': np.str})
        self.election_expenser_classifier = ElectionExpensesClassifier()

    def test_is_election_company(self):
        self.assertEqual(self.election_expenser_classifier.predict(self.dataset)[0], True)

    def test_is_not_election_company(self):
        self.assertEqual(self.election_expenser_classifier.predict(self.dataset)[1], False)

    def test_fit(self):
        self.assertEqual(self.election_expenser_classifier.fit(self.dataset), self.election_expenser_classifier)

    def test_tranform(self):
        self.assertEqual(self.election_expenser_classifier.transform(), self.election_expenser_classifier)

from unittest import TestCase

import numpy as np
import pandas as pd

from rosie.chamber_of_deputies.classifiers import ElectionExpensesClassifier


class TestElectionExpensesClassifier(TestCase):

    def setUp(self):
        self.dataset = pd.read_csv('rosie/chamber_of_deputies/tests/fixtures/election_expenses_classifier.csv',
                                   dtype={'name': np.str, 'legal_entity': np.str})
        self.subject = ElectionExpensesClassifier()

    def test_is_election_company(self):
        self.assertEqual(self.subject.predict(self.dataset)[0], True)

    def test_is_not_election_company(self):
        self.assertEqual(self.subject.predict(self.dataset)[1], False)

    def test_fit(self):
        self.assertEqual(self.subject.fit(self.dataset), self.subject)

    def test_tranform(self):
        self.assertEqual(self.subject.transform(), self.subject)

--- 
+++ 
@@ -11,16 +11,16 @@
     def setUp(self):
         self.dataset = pd.read_csv('rosie/chamber_of_deputies/tests/fixtures/election_expenses_classifier.csv',
                                    dtype={'name': np.str, 'legal_entity': np.str})
-        self.subject = ElectionExpensesClassifier()
+        self.election_expenser_classifier = ElectionExpensesClassifier()
 
     def test_is_election_company(self):
-        self.assertEqual(self.subject.predict(self.dataset)[0], True)
+        self.assertEqual(self.election_expenser_classifier.predict(self.dataset)[0], True)
 
     def test_is_not_election_company(self):
-        self.assertEqual(self.subject.predict(self.dataset)[1], False)
+        self.assertEqual(self.election_expenser_classifier.predict(self.dataset)[1], False)
 
     def test_fit(self):
-        self.assertEqual(self.subject.fit(self.dataset), self.subject)
+        self.assertEqual(self.election_expenser_classifier.fit(self.dataset), self.election_expenser_classifier)
 
     def test_tranform(self):
-        self.assertEqual(self.subject.transform(), self.subject)
+        self.assertEqual(self.election_expenser_classifier.transform(), self.election_expenser_classifier)
Remove a Rails accent of use subject in favor of Zen of Python: explicit is better than implicit and readbility counts
