def test_fetch_inactive_objects(self):
        exp_request = Request.get(adt_uri='activation/inactiveobjects')

        conn = Connection(responses=[(RESPONSE_INACTIVE_OBJECTS_V1,
                                      exp_request)])
        conn.asserter = self

        my_inactive_objects = sap.adt.wb.fetch_inactive_objects(conn)

        self.assertEquals(
            my_inactive_objects.entries[0].transport.reference.name,
            'C50K000377')
        self.assertEquals(my_inactive_objects.entries[1].object.reference.name,
                          'CL_HELLO_WORLD')
Esempio n. 2
0
    def test_checkout_ok(self):
        self.conn.set_responses(
            Response.with_json(
                status_code=200,
                json={'result': {
                    'fromCommit': '123',
                    'toCommit': '456'
                }}))

        repo = sap.rest.gcts.Repository(self.conn,
                                        self.repo_name,
                                        data=self.repo_server_data)
        repo.checkout('the_other_branch')

        self.assertIsNone(repo._data)

        self.assertEqual(len(self.conn.execs), 1)
        self.conn.execs[0].assertEqual(
            Request.get(
                adt_uri=
                f'repository/{self.repo_name}/branches/the_branch/switch',
                params={'branch': 'the_other_branch'}), self)