gendata.py 537 字节
Newer Older
1
#!/usr/bin/env python
C
Cleber Rosa 已提交
2 3 4

import os

5
from avocado import Test
6
from avocado import main
C
Cleber Rosa 已提交
7 8


9
class GenDataTest(Test):
C
Cleber Rosa 已提交
10 11 12 13 14

    """
    Simple test that generates data to be persisted after the test is run
    """

15
    def test_json(self):
C
Cleber Rosa 已提交
16
        import json
17
        output_path = os.path.join(self.outputdir, "test.json")
C
Cleber Rosa 已提交
18
        output = {"basedir": self.basedir,
19
                  "outputdir": self.outputdir}
20 21
        with open(output_path, "w") as output_file:
            json.dump(output, output_file)
C
Cleber Rosa 已提交
22 23 24


if __name__ == "__main__":
25
    main()