def test_json_format(self, m): m.return_value.query.return_value.all.return_value = [ Proxy(), ] CliRunner().invoke(list_command, [ '--format', 'json', ])
def test_table_format(self, m): m.return_value.query.return_value.all.return_value = [ Proxy(), ] CliRunner().invoke(list_command, [ '--format', 'grid-table', ])
def test_str(self): self.assertEqual(str(Proxy(id=self.proxy_id)), self.proxy_id)
def test_line_format(self, m): m.return_value.query.return_value.all.return_value = [ Proxy(created_at=datetime.datetime.now()), ] CliRunner().invoke(list_command)
def test_copy(self): self.assertEqual( Proxy(id=self.proxy_id).copy(), {key: self.proxy_id for key in PROTOCOLS})
def test_in(self): proxy = Proxy(id=self.proxy_id) for protocol in PROTOCOLS: self.assertTrue(protocol in proxy)
def test_vote(self, m): Proxy(id=self.proxy_id).positive() Proxy(id=self.proxy_id).negative()
def test_get_default(self): self.assertEqual(Proxy(id=self.proxy_id).get('spam', 'foo'), 'foo')
def test_get(self): self.assertEqual(Proxy(id=self.proxy_id).get('http'), self.proxy_id)