~canonical-platform-qa/snappy-ecosystem-tests/fixing_ci

« back to all changes in this revision

Viewing changes to tests/storeconfig.py

  • Committer: iahmad
  • Date: 2017-02-03 07:02:58 UTC
  • Revision ID: iftikhar.ahmad@canonical.com-20170203070258-g46zkumbqhzp527t
snapcraft wrapper, login and logout tests using snapcraft and webinterface, baseclass for selenium based web tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
 
 
3
 
 
4
def get_store_credentials():
 
5
    """login credentials exported by shell environment"""
 
6
    email=None
 
7
    password=None
 
8
 
 
9
    try:
 
10
        email=os.environ['UBUNTU_STORE_LOGIN_EMAIL']
 
11
        password=os.environ['UBUNTU_STORE_LOGIN_PASSWORD']
 
12
    except KeyError as err:
 
13
        print (err.message)
 
14
 
 
15
    return email, password
 
16
 
 
17
 
 
18
def is_staging():
 
19
    """Return False if environment variable PROD is exported"""
 
20
    staging = True
 
21
    try:
 
22
        if os.environ["STAGING"] == "0":
 
23
            staging = False
 
24
    except KeyError:
 
25
        pass
 
26
 
 
27
    return staging
 
28
 
 
29
 
 
30
def get_store_web_url():
 
31
    """This will return Ubuntu Store web url from staging server,
 
32
    if optional staging argument is false then it will return
 
33
    production server url """
 
34
    return "https://myapps.developer.staging.ubuntu.com/" if is_staging() \
 
35
            else "https://myapps.developer.ubuntu.com/"
 
 
b'\\ No newline at end of file'