How to use the tasklib.lazy.LazyUUIDTaskSet function in tasklib

To help you get started, we’ve selected a few tasklib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robgolding / tasklib / tasklib / tests.py View on Github external
def test_simple_dependency_lazyuuidtaskset_save_before_repeatedly(self):
        # Adds only one dependency as LazyUUIDTaskSet to a saved task with no dependencies
        t = Task(self.tw, description='test task')
        dependency = Task(self.tw, description='needs to be done first')
        dependency.save()
        t.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency['uuid']])
        t.save()

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_set_complex_dependency_lazyuuidtaskset(self):
        # Adds two dependencies as a LazyUUIDTaskSet to task with no dependencies
        t = Task(self.tw, description='test task')
        dependency1 = Task(self.tw, description='needs to be done first')
        dependency2 = Task(self.tw, description='needs to be done second')

        t.save()
        dependency1.save()
        dependency2.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency1['uuid'], dependency2['uuid']])

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency1['uuid'], dependency2['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_set_simple_dependency_lazyuuidtaskset(self):
        # Adds only one dependency as a LazyUUIDTaskSet to task with no dependencies
        t = Task(self.tw, description='test task')
        dependency = Task(self.tw, description='needs to be done first')

        t.save()
        dependency.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency['uuid']])

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_add_lazyuuidtaskset_to_dependency_lazyuuidtaskset(self):
        # Adds dependency as LazyUUIDTaskSet to task with one dependencies as LazyUUIDTaskSet
        t = Task(self.tw, description='test task')
        dependency1 = Task(self.tw, description='needs to be done first')
        dependency2 = Task(self.tw, description='needs to be done second')

        dependency1.save()
        dependency2.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency1['uuid']])
        t.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency2['uuid']]).union(t['depends'])
        t.save()

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency1['uuid'], dependency2['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_remove_from_dependency_lazyuuidtaskset(self):
        # Removes dependency from task with two dependencies as LazyUUIDTaskSet
        t = Task(self.tw, description='test task')
        dependency1 = Task(self.tw, description='needs to be done first')
        dependency2 = Task(self.tw, description='needs to be done second')

        dependency1.save()
        dependency2.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency1['uuid'], dependency2['uuid']])
        t.save()

        t['depends'].remove(dependency2)
        t.save()

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency1['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_remove_from_dependency_lazyuuidtaskset(self):
        # Removes dependency from task with two dependencies as LazyUUIDTaskSet
        t = Task(self.tw, description='test task')
        dependency1 = Task(self.tw, description='needs to be done first')
        dependency2 = Task(self.tw, description='needs to be done second')

        dependency1.save()
        dependency2.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency1['uuid'], dependency2['uuid']])
        t.save()

        t['depends'].remove(dependency2)
        t.save()

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency1['uuid']]))
github robgolding / tasklib / tasklib / tests.py View on Github external
def test_simple_dependency_lazyuuidtaskset_save_before_repeatedly(self):
        # Adds only one dependency as LazyUUIDTaskSet to a saved task with no dependencies
        t = Task(self.tw, description='test task')
        dependency = Task(self.tw, description='needs to be done first')
        dependency.save()
        t.save()

        t['depends'] = LazyUUIDTaskSet(self.tw, [dependency['uuid']])
        t.save()

        self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency['uuid']]))
github robgolding / tasklib / tasklib / lazy.py View on Github external
def intersection(self, other):
        return LazyUUIDTaskSet(
            self._tw,
            self._uuids & set(t['uuid'] for t in other),
        )
github robgolding / tasklib / tasklib / lazy.py View on Github external
def symmetric_difference(self, other):
        return LazyUUIDTaskSet(
            self._tw,
            self._uuids ^ set(t['uuid'] for t in other),
        )