Example #1
0
 def test_save_persists_related_space(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.related_space)
     chart.related_space = 1234
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.related_space)
Example #2
0
 def test_save_persists_log_y_axis(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.use_log_yaxis)
     chart.use_log_yaxis = True
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.use_log_yaxis)
Example #3
0
 def test_save_persists_use_last_value(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.use_last_value)
     chart.use_last_value = True
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.use_last_value)
Example #4
0
 def test_save_persists_use_last_value(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.use_last_value)
     chart.use_last_value = True
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.use_last_value)
Example #5
0
 def test_save_persists_label(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.label)
     chart.label = 'my label'
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertEqual(found.label, 'my label')
Example #6
0
 def test_save_persists_type(self):
     # Ensure that type gets passed in the payload
     for t in ['stacked', 'bignumber']:
         chart = Chart(self.conn, space_id=self.space.id, type=t)
         chart.save()
         found = self.conn.get_chart(chart.id, self.space.id)
         self.assertEqual(found.type, t)
Example #7
0
 def test_save_persists_related_space(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.related_space)
     chart.related_space = 1234
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.related_space)
Example #8
0
 def test_save_persists_log_y_axis(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.use_log_yaxis)
     chart.use_log_yaxis = True
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertTrue(found.use_log_yaxis)
Example #9
0
 def test_save_persists_label(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.label)
     chart.label = 'my label'
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertEqual(found.label, 'my label')
Example #10
0
 def test_save_persists_type(self):
     # Ensure that type gets passed in the payload
     for t in ['stacked', 'bignumber']:
         chart = Chart(self.conn, space_id=self.space.id, type=t)
         chart.save()
         found = self.conn.get_chart(chart.id, self.space.id)
         self.assertEqual(found.type, t)
Example #11
0
 def test_save_persists_min_max(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.min)
     self.assertIsNone(chart.max)
     chart.min = 5
     chart.max = 30
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertEqual(found.min, 5)
     self.assertEqual(found.max, 30)
Example #12
0
 def test_save_persists_min_max(self):
     chart = Chart(self.conn, space_id=self.space.id)
     self.assertIsNone(chart.min)
     self.assertIsNone(chart.max)
     chart.min = 5
     chart.max = 30
     chart.save()
     found = self.conn.get_chart(chart.id, self.space.id)
     self.assertEqual(found.min, 5)
     self.assertEqual(found.max, 30)
Example #13
0
 def test_save_chart(self):
     chart = Chart(self.conn, 'test', space_id=self.space.id)
     self.assertFalse(chart.persisted())
     self.assertIsNone(chart.id)
     resp = chart.save()
     self.assertIsInstance(resp, Chart)
     self.assertTrue(chart.persisted())
     self.assertIsNotNone(chart.id)
     self.assertEqual(chart.type, 'line')
Example #14
0
 def test_save_chart(self):
     chart = Chart(self.conn, 'test', space_id=self.space.id)
     self.assertFalse(chart.persisted())
     self.assertIsNone(chart.id)
     resp = chart.save()
     self.assertIsInstance(resp, Chart)
     self.assertTrue(chart.persisted())
     self.assertIsNotNone(chart.id)
     self.assertEqual(chart.type, 'line')