mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
diaspora: Convert tests to pytest style
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
This commit is contained in:
parent
377a50e213
commit
a195fdca57
@ -20,25 +20,21 @@ Test Apache configuration generation for diaspora*
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from plinth.modules import diaspora
|
||||
|
||||
|
||||
class TestDiaspora(unittest.TestCase):
|
||||
"""Test Apache configuration for Diaspora module."""
|
||||
def test_generate_apache_configuration():
|
||||
"""Test that Apache configuration is created properly."""
|
||||
with tempfile.NamedTemporaryFile() as conf_file:
|
||||
diaspora.generate_apache_configuration(conf_file.name,
|
||||
'freedombox.rocks')
|
||||
|
||||
def test_generate_apache_configuration(self):
|
||||
"""Test that Apache configuration is created properly."""
|
||||
with tempfile.NamedTemporaryFile() as conf_file:
|
||||
diaspora.generate_apache_configuration(conf_file.name,
|
||||
'freedombox.rocks')
|
||||
assert os.stat(conf_file.name).st_size != 0
|
||||
|
||||
assert os.stat(conf_file.name).st_size != 0
|
||||
with open(conf_file.name) as file_handle:
|
||||
contents = file_handle.read()
|
||||
|
||||
with open(conf_file.name) as file_handle:
|
||||
contents = file_handle.read()
|
||||
|
||||
assert all(
|
||||
word in contents
|
||||
for word in ['VirtualHost', 'Location', 'Directory', 'assets'])
|
||||
assert all(
|
||||
word in contents
|
||||
for word in ['VirtualHost', 'Location', 'Directory', 'assets'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user