def test_addon1_uncommitted_change(self):
     """ test with a local uncommitted change without version change """
     addon1_dir = os.path.join(DATA_DIR, "addon1")
     manifest_path = os.path.join(addon1_dir, "__openerp__.py")
     manifest = open(manifest_path).read()
     try:
         open(manifest_path, "w").write(manifest.replace("summary", "great summary"))
         version = git_postversion.get_git_postversion(addon1_dir)
         assert version == "8.0.1.0.0.99.dev3"
     finally:
         open(manifest_path, "w").write(manifest)
 def test_addon2_uncommitted_version_change(self):
     """ test with a local uncommitted version change """
     addon2_dir = os.path.join(DATA_DIR, "addon2")
     manifest_path = os.path.join(addon2_dir, "__openerp__.py")
     manifest = open(manifest_path).read()
     try:
         open(manifest_path, "w").write(manifest.replace("8.0.1.0.1", "8.0.1.0.2"))
         version = git_postversion.get_git_postversion(addon2_dir)
         assert version == "8.0.1.0.2.dev1"
     finally:
         open(manifest_path, "w").write(manifest)
 def test_addon1_uncommitted_change(self):
     """ test with a local uncommitted change without version change """
     addon1_dir = os.path.join(DATA_DIR, 'addon1')
     manifest_path = os.path.join(addon1_dir, '__openerp__.py')
     manifest = open(manifest_path).read()
     try:
         open(manifest_path,
              "w").write(manifest.replace("summary", "great summary"))
         version = git_postversion.get_git_postversion(addon1_dir)
         assert version == '8.0.1.0.0.99.dev3'
     finally:
         open(manifest_path, "w").write(manifest)
 def test_addon2_uncommitted_version_change(self):
     """ test with a local uncommitted version change """
     addon2_dir = os.path.join(DATA_DIR, 'addon2')
     manifest_path = os.path.join(addon2_dir, '__openerp__.py')
     manifest = open(manifest_path).read()
     try:
         open(manifest_path,
              "w").write(manifest.replace("8.0.1.0.1", "8.0.1.0.2"))
         version = git_postversion.get_git_postversion(addon2_dir)
         assert version == '8.0.1.0.2.dev1'
     finally:
         open(manifest_path, "w").write(manifest)
def test_addon1_uncommitted_change():
    """ test with a local uncommitted change without version change """
    addon1_dir = os.path.join(DATA_DIR, "addon1")
    manifest_path = os.path.join(addon1_dir, "__openerp__.py")
    with open(manifest_path) as f:
        manifest = f.read()
    try:
        with open(manifest_path, "w") as f:
            f.write(manifest.replace("summary", "great summary"))
        version = get_git_postversion(addon1_dir, STRATEGY_99_DEVN)
        assert version == "8.0.1.0.0.99.dev5"
        version = get_git_postversion(addon1_dir, STRATEGY_P1_DEVN)
        assert version == "8.0.1.0.1.dev5"
    finally:
        with open(manifest_path, "w") as f:
            f.write(manifest)
def test_addon2_uncommitted_version_change():
    """ test with a local uncommitted version change """
    addon2_dir = os.path.join(DATA_DIR, "addon2")
    manifest_path = os.path.join(addon2_dir, "__openerp__.py")
    with open(manifest_path) as f:
        manifest = f.read()
    try:
        with open(manifest_path, "w") as f:
            f.write(manifest.replace("8.0.1.0.1", "8.0.1.0.2"))
        version = get_git_postversion(addon2_dir, STRATEGY_99_DEVN)
        assert version == "8.0.1.0.2.dev1"
        version = get_git_postversion(addon2_dir, STRATEGY_P1_DEVN)
        assert version == "8.0.1.0.2.dev1"
    finally:
        with open(manifest_path, "w") as f:
            f.write(manifest)