def setup(self):
     self.hardware = SimpleHardwareAdapter(['a', 'b', 'c'])
     self.commands = HardwareCommands(self.hardware)
class TestHardwareCommands():

    def setup(self):
        self.hardware = SimpleHardwareAdapter(['a', 'b', 'c'])
        self.commands = HardwareCommands(self.hardware)

    def testSetcut(self):
        print "*******"
        self.commands.setcut()
        print "*******"
        self.commands.setcut('a')
        print "*******"
        self.commands.setcut('a', -181)
        print "*******"
        eq_(self.commands._hardware.get_cuts()['a'], -181)
        assert_raises(
            ValueError, self.commands.setcut, 'a', 'not a number')
        assert_raises(
            KeyError, self.commands.setcut, 'not an axis', 1)

    def test_set_lim(self):
        self.commands.setmin('a', -1)
        print "*******"
        self.commands.setmin()
        print "*******"
        self.commands.setmax()
        print "*******"