~aleteoryx/muditaos

ref: 39255b2d45ffacb9de27d211c79d6a6763d69bcf muditaos/test/pytest/service-desktop/test_send_file.py -rw-r--r-- 847 bytes
39255b2d — Paweł Joński [BH-743] AlarmEvent UT 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
import pytest
import filecmp


from harness.api.filesystem import get_file, put_file

fileName = "lorem-ipsum.txt"


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.rt1051
def test_send_file(harness):
    """
    Attempt requesting and sending file to Pure
    """
    put_file(harness, fileName, "/sys/user/")


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.rt1051
def test_get_file_back(harness):
    """
    Attempt requesting and transfering file data
    """
    loadedFile = "./lorem-ipsum-2.txt"

    get_file(harness, fileName, "./", "/sys/user/", loadedFile)

    assert filecmp.cmp(fileName, loadedFile, shallow=True)