class Test_FirstColumnDirection(unittest.TestCase): path = 'test_data.csv' df = pd.read_csv(path, index_col='date', na_values='null') scale_one_hundred = scalefuncs.chart_scale_one_hundred() scale_percent = scalefuncs.chart_scale_percent(1, 100, percent=6, ndigits=2) scale_traditional = scalefuncs.chart_scale_traditional(1, 100) scale_fixed_boxsize = scalefuncs.chart_scale_fixed_boxsize(min_value=5, max_value=100, box_size=5) # x_traditional x_percent x_100 x_101 o_traditional o_percent o_100 def test_x_column(self): direction = datadefs.Direction.X self.assertEqual( direction, scalefuncs.getFirstColumnDirection(self.df, 'x_traditional', self.scale_traditional)) def test_o_column(self): direction = datadefs.Direction.O def test_undefined_column(self): direction = datadefs.Direction.Undefined """
class Test_FirstColumnDirection(unittest.TestCase): path = 'test_data_one_hundred_X.csv' df = pd.read_csv(path, index_col='date', na_values='null') scale_one_hundred = scalefuncs.chart_scale_one_hundred() scale_percent = scalefuncs.chart_scale_percent(1, 100, percent=6, ndigits=2) scale_traditional = scalefuncs.chart_scale_traditional(1, 100) scale_fixed_boxsize = scalefuncs.chart_scale_fixed_boxsize(min_value=5, max_value=100, box_size=5)
def test_chart_scale_one_hundred(self): self.assertEqual(scalefuncs.chart_scale_one_hundred(), [float(x) for x in range(0, 101, 2)])
def set_chart_scale_one_hundred(self): if self.scale_type != ScaleType.Undefined: raise RuntimeError('This chart has already been setup.') self.scale_type = ScaleType.OneHundred self.scale = scalefuncs.chart_scale_one_hundred()