Esempio n. 1
0
 def __init__(self,
              api_url,
              api_token,
              cmd,
              title,
              skip_confirmation,
              recorder=None,
              uploader=None,
              confirmator=None):
     self.api_url = api_url
     self.api_token = api_token
     self.cmd = cmd
     self.title = title
     self.skip_confirmation = skip_confirmation
     self.recorder = recorder if recorder is not None else Recorder()
     self.uploader = uploader if uploader is not None else Uploader()
     self.confirmator = confirmator if confirmator is not None else Confirmator(
     )
Esempio n. 2
0
    def test_confirm_when_foo_entered(self):
        confirmator = Confirmator()
        self.stdin.set_line("foo\n")

        assert not confirmator.confirm('Wanna?')
        assert_printed('Wanna?')
Esempio n. 3
0
    def test_confirm_when_spaces_entered(self):
        confirmator = Confirmator()
        self.stdin.set_line("  \n")

        assert confirmator.confirm('Wanna?')
        assert_printed('Wanna?')
Esempio n. 4
0
    def test_confirm_when_foo_entered(self):
        confirmator = Confirmator()
        self.stdin.set_line("foo\n")

        assert not confirmator.confirm('Wanna?')
        assert_printed('Wanna?')
Esempio n. 5
0
    def test_confirm_when_spaces_entered(self):
        confirmator = Confirmator()
        self.stdin.set_line("  \n")

        assert confirmator.confirm('Wanna?')
        assert_printed('Wanna?')