File: test.py

package info (click to toggle)
subuser 0.6.2-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,216 kB
  • sloc: python: 5,204; sh: 380; makefile: 73; javascript: 43
file content (21 lines) | stat: -rwxr-xr-x 533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-

"""
This is a "magic" module used to transmit the global testing flag, so modules will know if they are being tested.  (Some modules use mock objects, others don't do certain actions during testing.)
"""

#external imports
import os
#internal imports
#import ...

if "SUBUSER_TESTING" in os.environ:
  testing = True
  import os
  homeDir = os.getcwd()
  hashtestDir = homeDir+"/hashtest"
  def getUser():
    from subuserlib.classes.user import User
    return User(homeDir=homeDir)
else:
  testing = False