File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,28 @@ def test_populate(self):
5353 assert_true (self .ephys )
5454 assert_true (self .channel )
5555
56+ def test_populate_exclude_error_and_ignore_jobs (self ):
57+ # test simple populate
58+ assert_true (self .subject , "root tables are empty" )
59+ assert_false (self .experiment , "table already filled?" )
60+
61+ keys = self .experiment .key_source .fetch ("KEY" , limit = 2 )
62+ for idx , key in enumerate (keys ):
63+ schema .jobs .insert1 (
64+ {
65+ "table_name" : self .experiment .table_name ,
66+ "key_hash" : dj .hash .key_hash (key ),
67+ "status" : "error" if idx == 0 else "ignore" ,
68+ "key" : key ,
69+ }
70+ )
71+
72+ self .experiment .populate (reserve_jobs = True )
73+ assert_equal (
74+ len (self .experiment .key_source & self .experiment ),
75+ len (self .experiment .key_source ) - 2 ,
76+ )
77+
5678 def test_allow_direct_insert (self ):
5779 assert_true (self .subject , "root tables are empty" )
5880 key = self .subject .fetch ("KEY" , limit = 1 )[0 ]
You can’t perform that action at this time.
0 commit comments