@pytest.mark.cmd
@pytest.mark.django_db
def test_import_emptyfile(capfd, tmpdir):
 p = tmpdir.mkdir('sub').join('empty.po')
 p.write('')
 with pytest.raises(CommandError) as e:
  call_command('import', os.path.join(p.dirname, p.basename))
 assert ('missing X-Pootle-Path header' in str(e))

@ pytest . mark . cmd @ pytest . mark . django_db def test_import_emptyfile ( capfd , tmpdir ) : p = tmpdir . mkdir ( 'sub' ) . join ( 'empty.po' ) p . write ( '' ) with pytest . raises ( CommandError ) as e : call_command ( 'import' , os . path . join ( p . dirname , p . basename ) ) assert ( 'missing X-Pootle-Path header' in str ( e ) )
load an empty po file .