Exemple #1
0
    def test_1(self):
        """Load Config File and json check
        """
        json = ConfigLoader("../config/test.json")
        json.load()

        assert json.data["hoge"] == "fuga"
        assert json.data["foo"] == "bar"
        assert json.data["baz"] == 123
Exemple #2
0
    def test_1(self):
        cfgLoader = ConfigLoader("../config/settings.json")
        twitter = TwitterApp(cfgLoader)

        assert twitter.do() is not False
Exemple #3
0
import pytest
import sys
import os.path as path
sys.path.append("..")
from pristella.config_loader import ConfigLoader
from pristella.twitter import Twitter


cfgLoader = ConfigLoader("../config/settings.json")
keys = cfgLoader.load()
twitter = Twitter(keys)


class TestClass(object):
    def test_1(self):
        res = twitter.tweet("This is test.\n日本語 あいうえお")

        assert res is not False

    def test_2(self):
        res = twitter.tweetWithPictures(
            "Tweet with Picture.",
            [path.abspath(path.join(path.dirname(__file__), "test.png"))])

        assert res is not False
Exemple #4
0
import pytest
import sys
import os.path as path
sys.path.append("..")
from pristella.config_loader import ConfigLoader
from pristella.twitter import Twitter

cfgLoader = ConfigLoader("../config/settings.json")
keys = cfgLoader.load()
twitter = Twitter(keys)


class TestClass(object):
    def test_1(self):
        res = twitter.tweet("This is test.\n日本語 あいうえお")

        assert res is not False

    def test_2(self):
        res = twitter.tweetWithPictures(
            "Tweet with Picture.",
            [path.abspath(path.join(path.dirname(__file__), "test.png"))])

        assert res is not False
Exemple #5
0
    def test_2(self):
        """Save Config File
        """
        json = ConfigLoader("../config/test.json")
        json.load()

        json.data["added"] = "done"

        assert json.save()

        json2 = ConfigLoader("../config/test.json")
        json2.load()

        assert json2.data["added"] == "done"

        del json2.data["added"]
        assert json2.save()

        json3 = ConfigLoader("../config/test.json")
        json3.load()

        assert "added" not in json3.data