@@ -64,12 +64,34 @@ def test_dont_overwrite_password_on_wrong_login(dictproxy):
6464    assert  res ["password" ] ==  res2 ["password" ]
6565
6666
67- def  test_nocreate_file (monkeypatch , tmpdir , dictproxy ):
68-     p  =  tmpdir .join ("nocreate" )
69-     p .write ("" )
70-     monkeypatch .setattr (chatmaild .doveauth , "NOCREATE_FILE" , str (p ))
71-     dictproxy .
lookup_passdb (
"[email protected] " , 
"zequ0Aimuchoodaechik" )
 72-     assert  not  dictproxy .
lookup_userdb (
"[email protected] " )
 67+ @pytest .mark .parametrize ( 
68+     ["nocreate_file" , "account" , "invite_token" , "password" ], 
69+     [ 
70+         (False , True , "asdf" , "asdfasdmaimfelsgwerw" ), 
71+         (False , True , "asdf" , "z9873240187420913798" ), 
72+         (False , True , "" , "dsaiujfw9fjiwf9w" ), 
73+         (True , True , "asdf" , 'asdfmosadkdkfwdofkw' ), 
74+         (True , False , "asdf" , "z9873240187420913798" ), 
75+         (True , False , "" , "dsaiujfw9fjiwf9w" ), 
76+     ], 
77+ ) 
78+ def  test_nocreate_file (
79+     monkeypatch ,
80+     tmpdir ,
81+     dictproxy ,
82+     example_config ,
83+     nocreate_file : bool ,
84+     account : bool ,
85+     invite_token : str ,
86+     password : str ,
87+ ):
88+     if  nocreate_file :
89+         p  =  tmpdir .join ("nocreate" )
90+         p .write ("" )
91+         monkeypatch .setattr (chatmaild .doveauth , "NOCREATE_FILE" , str (p ))
92+     example_config .invite_token  =  invite_token 
93+     dictproxy .
lookup_passdb (
"[email protected] " , 
password )
 94+     assert  bool (
dictproxy .
lookup_userdb (
"[email protected] " )) 
==  account  7395
7496
7597def  test_handle_dovecot_request (dictproxy ):
0 commit comments