'Test directory_source.get_new_files() success.'

def test_get_new_files_success(self):

    path = '/some/valid/path'
    file1_full_path = os.path.join(path, 'file1')
    file2_full_path = os.path.join(path, 'file2')
    file3_full_path = os.path.join(path, 'file3')
    os.listdir.expect_call(path).and_return(['file1', 'file2', 'file3'])
    stat_result = self._get_stat_result(size=1010, mtime=123)
    self._stat_mock.expect_call(file1_full_path).and_return(stat_result)
    stat_result = self._get_stat_result(size=1020, mtime=1234)
    self._stat_mock.expect_call(file2_full_path).and_return(stat_result)
    stat_result = self._get_stat_result(size=1030, mtime=12345)
    self._stat_mock.expect_call(file3_full_path).and_return(stat_result)
    known_files = {'file2': source.database.item(file2_full_path, 1020, 1234)}
    self.db_mock.get_dictionary.expect_call().and_return(known_files)
    s = source.directory_source(self.db_mock, path)
    expected = {'file1': source.database.item(file1_full_path, 1010, 123), 'file3': source.database.item(file3_full_path, 1030, 12345)}
    self.assertEquals(expected, s.get_new_files(_stat_func=self._stat_mock))
    self.god.check_playback()
