@@ -1582,6 +1582,8 @@ def __run(self, import_paths, singletons=True, detailed=False):
1582
1582
with capture_log () as logs :
1583
1583
self .importer .run ()
1584
1584
1585
+ logs = [line for line in logs if not line .startswith ('Sending event:' )]
1586
+
1585
1587
self .assertEqual (len (self .lib .items ()), 0 )
1586
1588
self .assertEqual (len (self .lib .albums ()), 0 )
1587
1589
@@ -1590,41 +1592,35 @@ def __run(self, import_paths, singletons=True, detailed=False):
1590
1592
def test_import_pretend (self ):
1591
1593
logs = self .__run (self .import_paths )
1592
1594
1593
- self .assertEqual (len (logs ), 3 )
1594
- self .assertEqual (logs [1 ], self .import_files [0 ])
1595
- self .assertEqual (logs [2 ], self .import_files [1 ])
1595
+ self .assertEqual (logs , self .import_files )
1596
1596
1597
1597
def test_import_pretend_empty (self ):
1598
1598
logs = self .__run ([self .empty_path ])
1599
1599
1600
- self .assertEqual (len (logs ), 2 )
1601
- self .assertEqual (logs [1 ], 'No files imported from {0}'
1602
- .format (displayable_path (self .empty_path )))
1600
+ self .assertEqual (logs , ['No files imported from {0}'
1601
+ .format (displayable_path (self .empty_path ))])
1603
1602
1604
1603
def test_import_singletons_pretend_detailed (self ):
1605
1604
logs = self .__run (self .import_paths , detailed = True )
1606
1605
1607
- self .assertEqual (len ( logs ), 3 )
1608
- self . assertEqual ( logs [ 1 ], 'Singleton: %s' % self .import_files [0 ])
1609
- self . assertEqual ( logs [ 2 ], 'Singleton: %s' % self .import_paths [1 ])
1606
+ self .assertEqual (logs , [
1607
+ 'Singleton: %s' % self .import_files [0 ],
1608
+ 'Singleton: %s' % self .import_paths [1 ] ])
1610
1609
1611
1610
def test_import_album_pretend_detailed (self ):
1612
1611
logs = self .__run (self .import_paths , singletons = False , detailed = True )
1613
1612
1614
- self .assertEqual (len (logs ), 5 )
1615
- self .assertEqual (logs [1 ],
1616
- 'Album %s' % displayable_path (self .import_paths [0 ]))
1617
- self .assertEqual (logs [2 ], self .import_files [0 ])
1618
- self .assertEqual (logs [3 ],
1619
- 'Album %s' % displayable_path (self .import_paths [1 ]))
1620
- self .assertEqual (logs [4 ], self .import_paths [1 ])
1613
+ self .assertEqual (logs , [
1614
+ 'Album %s' % displayable_path (self .import_paths [0 ]),
1615
+ self .import_files [0 ],
1616
+ 'Album %s' % displayable_path (self .import_paths [1 ]),
1617
+ self .import_paths [1 ]])
1621
1618
1622
1619
def test_import_pretend_empty_detailed (self ):
1623
1620
logs = self .__run ([self .empty_path ], detailed = True )
1624
1621
1625
- self .assertEqual (len (logs ), 2 )
1626
- self .assertEqual (logs [1 ], 'No files imported from {0}'
1627
- .format (displayable_path (self .empty_path )))
1622
+ self .assertEqual (logs , ['No files imported from {0}'
1623
+ .format (displayable_path (self .empty_path ))])
1628
1624
1629
1625
1630
1626
def suite ():
0 commit comments