def __init__(self, type_of_car: str, model: str, name: str, **kwargs):
        """Constructor"""

        Car.__init__(self, type_of_car, model, name,
                     kwargs['amount_of_passengers'],
                     kwargs['amount_of_wheels'])
        Electricity.__init__(self, kwargs['voltage'], kwargs['amperage'])
示例#2
0
class ElectricityTest(unittest.TestCase):

    # Setup method
    def setUp(self):
        # Initiate class
        self.thisElec = Electricity()

    # Test for the list to csv
    def testReadAll(self):

        # check for the right execution
        self.assertTrue(self.thisElec.readAll())
示例#3
0
class ElectricityTest(unittest.TestCase):

    # Setup method
    def setUp(self):
        # Initiate class
        self.thisElec = Electricity()

    # Test for the list to csv
    def testConvrtLstToCSV(self):
        # Define a list
        testList = ["a", "b", "c"]

        # Pass the list
        testCSV = self.thisElec.convrtLstToCSV(testList)

        # check for the right execution
        self.assertEqual(testCSV, "a,b,c")
示例#4
0
    def __init__(self, *args, **kwargs):
        self.power = ""
        # get data and merge on 'tds'
        if "Electricity" in args:
            self.power = "Electricity"
            self.data = Electricity().get_data(**kwargs)
        else:
            self.power = "Water"
            self.data = Water().get_data(**kwargs)
        self.coords = Coords().get_all_data()

        # cleanup the data
        self.merge_coords()
        self.add_year_column()
        self.set_dtypes()

        # compute df of mean consumption by (tds x year)
        self.tds_by_year = None
        self.get_by_year_data()

        # add other pre-computed dataframes here
        # ...
        self.tds_sum_year = None
        self.get_aggregate_data()
示例#5
0
 def setUp(self):
     # Initiate class
     self.thisElec = Electricity()
示例#6
0
文件: main.py 项目: vgutin/project-1
def get_electricity_counter(counter_id):
    elect = Electricity()
    return elect.get_counter(counter_id)
示例#7
0
文件: main.py 项目: vgutin/project-1
def get_electricity():
    elect = Electricity()
    return elect.get_all()