Exemplo n.º 1
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')
Exemplo n.º 2
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')
Exemplo n.º 3
0
 def test_chart_is_persisted_if_id_present(self):
     chart = Chart(self.conn, 'test', id=42)
     self.assertTrue(chart.persisted())
     chart = Chart(self.conn, 'test', id=None)
     self.assertFalse(chart.persisted())
Exemplo n.º 4
0
 def test_chart_is_not_persisted(self):
     chart = Chart('not saved', self.space)
     self.assertFalse(chart.persisted())
Exemplo n.º 5
0
 def test_chart_is_persisted_if_id_present(self):
     chart = Chart(self.conn, 'test', id=42)
     self.assertTrue(chart.persisted())
     chart = Chart(self.conn, 'test', id=None)
     self.assertFalse(chart.persisted())
Exemplo n.º 6
0
 def test_chart_is_not_persisted(self):
     chart = Chart('not saved', self.space)
     self.assertFalse(chart.persisted())