Exemplo n.º 1
0
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl

from co2dice.utils.logconfutils import init_logging
from co2dice._vendor.traitlets import config as trtc
from co2dice import tsigner, tstamp
import logging
import os
import unittest

import ddt

import os.path as osp

init_logging(level=logging.WARNING)

log = logging.getLogger(__name__)

mydir = osp.dirname(__file__)


@ddt.ddt
class TcfgcmdShell(unittest.TestCase):
    def _stamp_dir(self):
        return os.environ['STAMP_CHAIN_DIR']

    def test_DB_ENVAR(self):
        assert 'STAMP_CHAIN_DIR' in os.environ

    def _SigChain(self, cfg=None):
Exemplo n.º 2
0
from unittest import mock
import io
import json
import logging
import os
import shutil
import tempfile
import unittest

import ddt

import os.path as osp

from . import test_crypto as cryptotc

init_logging(level=logging.DEBUG)

log = logging.getLogger(__name__)

mydir = osp.dirname(__file__)


def mix_dics(d1, d2):
    d = d1.copy()
    d.update(d2)
    return d


class TCfgFilesRegistry(unittest.TestCase):
    def test_consolidate_1(self):
        visited = [
Exemplo n.º 3
0
from co2dice._vendor.traitlets import config as trtc
from co2dice import CmdException, crypto
from co2dice.base import PFiles
from co2dice.dicer import DicerSpec
from co2dice.project import ProjectsDB
from . import test_pgp_fingerprint, test_pgp_keys, test_pgp_trust
import logging

import pytest

from py.path import local   # @UnresolvedImport
import os.path as osp


mydir = osp.dirname(__file__)
init_logging(level=logging.INFO)
log = logging.getLogger(__name__)


def reset_git(pdb: ProjectsDB, ref):
    assert ref, "empty ref!  Pobably earlier failures."
    pdb.repo.git.reset(ref, hard=True)
    pdb._current_project = None
    p = pdb.current_project()

    return p


@pytest.fixture(scope='module')
def repodir(tmpdir_factory):
    repo = tmpdir_factory.mktemp('repo')