def test_002_directories(self):
     with cd("~"):
         result = run('ls')
         self.assertTrue("sites" in result.split())
     with cd("~/sites"):
         result = run('ls')
         self.assertTrue("todo.gdelo.com" in result.split())
 def test_006_selenium_installed(self):
     "Test Selenium webdriver is installed"
     with cd("~/wendy_workspace"):
         result = run("ls -l")
     with cd("~/wendy_workspace/application/functional_tests"):
         run("ls -l")
         result = run("python3.5 tests.py")
     print(result)
Пример #3
0
def setup_Xvfb():
    print("Installing pyvirtualdisplay.")
    with cd("~"):
        result = run("sudo apt-get -y install xvfb")
    with cd("~"):
        result = run("sudo pip3 install pyvirtualdisplay")
    print(result)
    print("pyvirtualdisplay installed")
Пример #4
0
def setup_firefox():
    print("Installing Firefox.")
    with cd("~"):
        result = run("sudo apt-get -y install firefox")
    with cd("~"):
        result = run("firefox -v")
    assert("Firefox" in result)
    print(result)
    print("Firefox installed")
Пример #5
0
 def test_005_app_installed(self):
     "Test that the application directory and software are present"
     with cd("~/workspace"):
         result = run("ls -l")
     self.assertTrue("application" in result)
     with cd("~/workspace/application"):
         result = run("ls -l")
     self.assertTrue("manage.py" in result)
     self.assertTrue("lists" in result)
Пример #6
0
def setup_django():
    print("Installing Django.")
    with cd("~"):
        result = run("sudo pip3 install django")
    with cd("~"):
        result = run("pip3 list | grep Django")
    print(result)
    print("Django installed")
    assert(result.startswith("Django"))
Пример #7
0
def setup_git():
    print("Installing git.")
    with cd("~"):
        result = run("sudo apt-get -y install git")
    with cd("~"):
        result = run("git --version")
    print(result)
    print("git is installed")
    assert(result.startswith("git"))
Пример #8
0
def setup_pip3():
    print("Installing pip3.")
    with cd("~"):
        result = run("sudo apt-get -y install python3-pip")
    with cd("~"):
        result = run("pip3 --version")
    print(result)
    print("pip3 is installed")
    assert(result.startswith("pip"))
Пример #9
0
def setup_application():
    print("Installing application")
    with cd("~/wendy_workspace"):
        run("wget https://github.com/hjwp/book-example/archive/chapter_07.zip")
        result = run("sudo apt-get -y install unzip")
        run("unzip chapter_07.zip")
        run("mv book-example-chapter_07 application")
    with cd("~/wendy_workspace/application"):
        run("python3 manage.py migrate")
    print("Application installed")
Пример #10
0
def setup_application():
    with cd("~/workspace"):
        run(setup + 
            "wget https://github.com/hjwp/book-example/archive/chapter_07.zip")
        run(setup + "unzip chapter_07.zip")
        run("mv book-example-chapter_07 application")
    with cd("~/workspace/application"):
        run(setup + "python3 manage.py migrate")
 def test_003_directory_pemission(self):
     with cd("~/sites"):
         result = run("ls -l")
         results = result.split("\n")
         for result in results:
             if "todo.gdelo.com" in result:
                 self.assertTrue("drwxrwxr-x" in result)
Пример #12
0
def setup_selenium():
    print("Installing Selenium.")
    with cd("~"):
        result = run("sudo pip3 install selenium")
    #with cd("~"):
        #result = run("pip3 list | grep Django")
    print(result)
    print("Selenium installed")
Пример #13
0
def setup_django():
    with cd("~"):
        result = run(setup + "pip3 install django")
    with cd("~"):
        result = run(setup + "pip3 list | grep Django")
    assert(result.startswith("Django"))
Пример #14
0
def start_application():
    with cd("~/wendy_workspace/application"):
        result = run("python3 manage.py runserver 127.0.0.1:8000")
        print(result)
        #run(setup + "nohup ps -aux \&")
        pass
Пример #15
0
 def test_004_django(self):
     "Django is installed."
     with cd("~"):
         result = run(setup + "pip3 list | grep Django")
     self.assertTrue(result.startswith("Django"))
Пример #16
0
 def test_003_git(self):
     "git is installed."
     with cd("~"):
         result = run(setup + "git --version")
     self.assertTrue(result.startswith("git"))
Пример #17
0
 def test_002_pip3(self):
     "Pip3 is installed."
     with cd("~"):
         result = run(setup + "pip3 --version")
     self.assertTrue(result.startswith("pip"))
Пример #18
0
 def test_001_python3(self):
     "Python 3 is installed."
     with cd("~"):
         result = run(setup + "python3 --version")
     self.assertTrue("Python 3" in result)
Пример #19
0
from remote_api import env,cd,run
from private import user, password

env.host_string = 'ssh.pythonanywhere.com'
env.user = user
env.password = password

with cd(""):
    print(run("ls -l | grep READ"))
 def test_000_python3(self):
     result = run("python3 --version")
     self.assertTrue("3.4" in result)
Пример #21
0
 def test_007_django(self):
     "Firefox is installed."
     with cd("~"):
         result = run("firefox -v")
     self.assertTrue("Firefox" in result)
Пример #22
0
 def test_006_app_is_running(self):
     "Test that a Django application is running"
     with cd("~"):
         result = run("ps -aux | grep python")
     self.assertTrue("manage.py" in result)
Пример #23
0
from remote_api import env,run
import private

env.host_string = 'ssh.pythonanywhere.com'
env.user = private.user
env.password = private.password

with cd("~"):
    print(run("ls -l"))
Пример #24
0
 def test_000_login(self):
     "Server is present and we can log in."
     with cd("~/workspace"):
         result = run("whoami")
     self.assertTrue(env.user in result)