should-dingus

Software screenshot:
should-dingus
Dettagli del software:
Versione: 0.3
Data di caricamento: 11 May 15
Sviluppatore: Chris Wesseling
Licenza: Libero
Popolarità: 10

Rating: nan/5 (Total Votes: 0)

dovrebbe-dingus contiene un matcher personalizzato in modo da poter utilizzare should_dsl con Dingus chiama.
Un piccolo avvertimento: l'operatore | hack di should_dsl di realtà non va bene con il __ __or () di un Dingus. Penso che l'| hack è brutto, e non sono sicuro che mi piace should_dsl per esso. Questo è dove Rubino sembra davvero molto per me.
Hai solo bisogno di importarlo
>>> Dall'importazione should_dsl dovrebbe, should_not
>>> Da dingus importazione Dingus
>>> should_dingus importazione
chiamata
Controlli chiede un Dingus
>>> Stub = Dingus ('stub')
>>> Def some_function ():
... Stub ()
...
>>> Some_function | dovrebbe | chiamata (stub)
chiamata può anche verificare che dovrebbe essere chiamato una volta:
>>> Def some_function ():
... Stub ()
... Stub ()
...
>>> Stub.reset ()
>>> Some_function | dovrebbe | chiamata (stub)
>>> Stub.reset ()
>>> Some_function | dovrebbe | chiamata (stub) .Una volta
Traceback (chiamata più recente scorso):
...
ShouldNotSatisfied: è stato chiamato 2 volte, atteso 1
chiamare può anche controllare i parametri con with_params:
>>> Def some_function ():
... Stub (Vero, Kwak = 'Tuut', Braat = 'aap')
...
>>> Stub.reset ()
>>> Some_function | deve | chiamata (stub) .with_params (True, Kwak = 'Tuut', Braat = 'aap')
>>> Stub.reset ()
>>> Some_function | deve | chiamata (stub) .with_params (True, Kwak = 'Tuut')
Traceback (chiamata più recente scorso):
...
ShouldNotSatisfied: non è stato chiamato con params (True,) {'kwak': 'Tuut'}
with_params chiamata possono essere combinati con una volta:
>>> Def some_function ():
... Stub (Vero, Kwak = 'Tuut', Braat = 'aap')
...
>>> Stub.reset ()
>>> Some_function | deve | chiamata (stub) .once.with_params (True, Kwak = 'Tuut', Braat = 'aap')
>>> Stub.reset ()
>>> Some_function | | dovrebbe chiamata (stub) .with_params (True, Kwak = 'Tuut', Braat = 'aap') una volta

Requisiti .

  • Python

Programmi simili

teamcity-messages
teamcity-messages

15 Apr 15

random_instances
random_instances

11 May 15

BuildBot
BuildBot

17 Feb 15

Altri software di sviluppo Chris Wesseling

crawlidator
crawlidator

11 May 15

Commenti a should-dingus

I commenti non trovato
Aggiungi commento
Accendere le immagini!