def test_set_decenter_cannot_change(self): decenters = {'decenterRA': 1, 'decenterDec': 2} masterThread.set_decenter(self.cmd, decenters, self.gState, None) self.assertTrue(self.cmd.didFail) self.assertFalse(self.gState.decenter) self.assertEqual(self.gState.decenterRA, 0) self.assertEqual(self.gState.decenterDec, 0) self.assertEqual(self.gState.mangaDither, 'C')
def _set_decenter_ok(self, decenters): masterThread.set_decenter(self.cmd, {}, self.gState, True) masterThread.set_decenter(self.cmd, decenters, self.gState, None) self.assertEqual(self.gState.decenterRA, decenters.get('decenterRA', 0)) self.assertEqual(self.gState.decenterDec, decenters.get('decenterDec', 0)) self.assertEqual(self.gState.mangaDither, decenters.get('mangaDither', '?')) self.assertIn(self.cmd, self.gState.decenterCmd)
def test_set_decenter_disable(self): decenters = {'decenterRA': 1, 'decenterDec': 2, 'mangaDither': 'N'} masterThread.set_decenter(self.cmd, {}, self.gState, True) masterThread.set_decenter(self.cmd, decenters, self.gState, None) masterThread.set_decenter(self.cmd, {}, self.gState, False) self.assertFalse(self.gState.decenter) self.assertEqual(self.gState.decenterRA, 0) self.assertEqual(self.gState.decenterDec, 0) self.assertEqual(self.gState.mangaDither, 'C')
def test_set_decenter_enable(self): masterThread.set_decenter(self.cmd, {}, self.gState, True) self.assertTrue(self.gState.decenter)