Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.17.4.144
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/odoo/odoo/addons/base/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /opt/odoo/odoo/addons/base/tests/test_phase.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import unittest

from odoo.tests import common


#: Stores state information across multiple test classes
test_state = None

def setUpModule():
    global test_state
    test_state = {}

def tearDownModule():
    global test_state
    test_state = None


class TestPhaseInstall00(unittest.TestCase):
    """
    WARNING: Relies on tests being run in alphabetical order
    """
    @classmethod
    def setUpClass(cls):
        cls.state = None

    def test_00_setup(self):
        type(self).state = 'init'

    @common.at_install(False)
    def test_01_no_install(self):
        type(self).state = 'error'

    def test_02_check(self):
        self.assertEqual(self.state, 'init',
                         "Testcase state should not have been transitioned from 00")


class TestPhaseInstall01(unittest.TestCase):
    at_install = False

    def test_default_norun(self):
        self.fail("An unmarket test in a non-at-install case should not run")

    @common.at_install(True)
    def test_set_run(self):
        test_state['set_at_install'] = True


class TestPhaseInstall02(unittest.TestCase):
    """
    Can't put the check for test_set_run in the same class: if
    @common.at_install does not work for test_set_run, it won't work for
    the other one either. Thus move checking of whether test_set_run has
    correctly run indeed to a separate class.

    Warning: relies on *classes* being run in alphabetical order in test
    modules
    """
    def test_check_state(self):
        self.assertTrue(test_state.get('set_at_install'),
                        "The flag should be set if local overriding of runstate")

Anon7 - 2022
AnonSec Team