Esempio n. 1
0
 def setUp(self):
     TestBase.setUp(self)
     self.dataset = Dataset.save(self.test_dataset_ids['good_eats.csv'])
     Dataset.build_schema(self.dataset,
             self.test_data['good_eats.csv'].dtypes)
     self.formula = 'rating'
     self.name = 'test'
Esempio n. 2
0
 def setUp(self):
     TestBase.setUp(self)
     self._file_name = 'good_eats.csv'
     self._file_path = 'tests/fixtures/%s' % self._file_name
     self._file_uri = 'file://%s' % self._file_path
     self.url = 'http://formhub.org/mberg/forms/good_eats/data.csv'
     self.controller = Datasets()
Esempio n. 3
0
    def setUp(self):
        TestBase.setUp(self)

        self._file = 'file://tests/fixtures/good_eats.csv'
        self.dataset_id = create_dataset_from_url(self._file,
                allow_local_file=True)[ID]
        self.controller = Calculations()
        self.formula = 'amount + gps_alt'
        self.name = 'test'
Esempio n. 4
0
 def setUp(self):
     TestBase.setUp(self)
     self.dataset = Dataset.save(self.test_dataset_ids['good_eats.csv'])
     dframe = self.test_data['good_eats.csv']
     Dataset.build_schema(self.dataset, dframe.dtypes)
     Observation.save(dframe, self.dataset)
     self.calculations = [
         'rating',
         'gps',
         'amount + gps_alt',
         'amount - gps_alt',
         'amount + 5',
         'amount - gps_alt + 2.5',
         'amount * gps_alt',
         'amount / gps_alt',
         'amount * gps_alt / 2.5',
         'amount + gps_alt * gps_precision',
         '(amount + gps_alt) * gps_precision',
         'amount = 2',
         '10 < amount',
         '10 < amount + gps_alt',
         'not amount = 2',
         'not(amount = 2)',
         'amount = 2 and 10 < amount',
         'amount = 2 or 10 < amount',
         'not not amount = 2 or 10 < amount',
         'not amount = 2 or 10 < amount',
         '(not amount = 2) or 10 < amount',
         'not(amount = 2 or 10 < amount)',
         'amount ^ 3',
         '(amount + gps_alt) ^ 2 + 100',
         '-amount',
         '-amount < gps_alt - 100',
         'rating in ["delectible"]',
         'risk_factor in ["low_risk"]',
         'amount in ["9.0", "2.0", "20.0"]',
         '(risk_factor in ["low_risk"]) and (amount in ["9.0", "20.0"])',
     ]
     self.places = 5
Esempio n. 5
0
 def setUp(self):
     self.parser = Parser()
     self.row = {'VAR': 1}
     TestBase.setUp(self)
Esempio n. 6
0
 def setUp(self):
     TestBase.setUp(self)
     self.controller = Version()
Esempio n. 7
0
 def setUp(self):
     TestBase.setUp(self)
     self.controller = Root()
Esempio n. 8
0
 def setUp(self):
     TestBase.setUp(self)
Esempio n. 9
0
 def setUp(self):
     TestBase.setUp(self)
     self.dataset = Dataset.save(self.test_dataset_ids['good_eats.csv'])
     Dataset.build_schema(self.dataset,
             self.test_data['good_eats.csv'].dtypes)