|
@@ 65-103 (lines=39) @@
|
| 62 |
|
|
| 63 |
|
assert os.path.exists(path) |
| 64 |
|
|
| 65 |
|
def test_data_out(self): |
| 66 |
|
"""Verify a sample file is created.""" |
| 67 |
|
path = os.path.join(FILES, 'mine-out.yml') |
| 68 |
|
|
| 69 |
|
if os.path.exists(path): |
| 70 |
|
os.remove(path) |
| 71 |
|
|
| 72 |
|
data = Data() |
| 73 |
|
yorm.sync(data, path) |
| 74 |
|
|
| 75 |
|
itunes = Application('itunes') |
| 76 |
|
itunes.versions.mac = '' |
| 77 |
|
itunes.versions.windows = 'iTunes.exe' |
| 78 |
|
|
| 79 |
|
iphoto = Application('iphoto') |
| 80 |
|
iphoto.versions.mac = 'iPhoto' |
| 81 |
|
|
| 82 |
|
mac = Computer('macbook', 'Jaces-MacBook', 'AA:BB:CC:DD:EE:FF') |
| 83 |
|
mac2 = Computer('macbook-pro', 'Jaces-MacBook-2', '11:22:33:44:55:66') |
| 84 |
|
|
| 85 |
|
configuration = ProgramConfig() |
| 86 |
|
configuration.applications = [itunes, iphoto] |
| 87 |
|
configuration.computers = [mac, mac2] |
| 88 |
|
|
| 89 |
|
data.config = configuration |
| 90 |
|
|
| 91 |
|
mac_state = State('macbook-pro') |
| 92 |
|
mac_state.timestamp.started = 444 |
| 93 |
|
|
| 94 |
|
itunes_status = Status('itunes') |
| 95 |
|
itunes_status.computers = [mac_state] |
| 96 |
|
|
| 97 |
|
status = ProgramStatus() |
| 98 |
|
status.applications = [itunes_status] |
| 99 |
|
status.counter = 499 |
| 100 |
|
|
| 101 |
|
data.status = status |
| 102 |
|
|
| 103 |
|
assert os.path.exists(path) |
| 104 |
|
|
| 105 |
|
def test_data_in(self): |
| 106 |
|
"""Verify a sample file is loaded.""" |
|
@@ 25-63 (lines=39) @@
|
| 22 |
|
class TestFiles: |
| 23 |
|
"""Integration tests for creating files.""" |
| 24 |
|
|
| 25 |
|
def test_data(self): |
| 26 |
|
"""Verify a sample file is created.""" |
| 27 |
|
path = os.path.join(FILES, 'mine.yml') |
| 28 |
|
|
| 29 |
|
if os.path.exists(path): |
| 30 |
|
os.remove(path) |
| 31 |
|
|
| 32 |
|
data = Data() |
| 33 |
|
yorm.sync(data, path) |
| 34 |
|
|
| 35 |
|
itunes = Application('itunes') |
| 36 |
|
itunes.versions.mac = '' |
| 37 |
|
itunes.versions.windows = 'iTunes.exe' |
| 38 |
|
|
| 39 |
|
iphoto = Application('iphoto') |
| 40 |
|
iphoto.versions.mac = 'iPhoto' |
| 41 |
|
|
| 42 |
|
mac = Computer('macbook', 'Other.local') |
| 43 |
|
mac2 = Computer('macbook-pro') |
| 44 |
|
|
| 45 |
|
configuration = ProgramConfig() |
| 46 |
|
configuration.applications = [itunes, iphoto] |
| 47 |
|
configuration.computers = [mac, mac2] |
| 48 |
|
|
| 49 |
|
data.config = configuration |
| 50 |
|
|
| 51 |
|
mac_state = State('macbook-pro') |
| 52 |
|
mac_state.timestamp.started = 444 |
| 53 |
|
|
| 54 |
|
itunes_status = Status('itunes') |
| 55 |
|
itunes_status.computers = [mac_state] |
| 56 |
|
|
| 57 |
|
status = ProgramStatus() |
| 58 |
|
status.applications = [itunes_status] |
| 59 |
|
status.counter = 499 |
| 60 |
|
|
| 61 |
|
data.status = status |
| 62 |
|
|
| 63 |
|
assert os.path.exists(path) |
| 64 |
|
|
| 65 |
|
def test_data_out(self): |
| 66 |
|
"""Verify a sample file is created.""" |