<s> from __future__ import unicode_literals <EOL> import helper <EOL> import grp <EOL> import os <EOL> import unittest <EOL> import ops <EOL> class GroupTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . id = os . getgid ( ) <EOL> self . name = grp . getgrgid ( self . id ) [ <NUM_LIT:0> ] <EOL> def test_default ( self ) : <EOL> group = ops . group ( self . name ) <EOL> self . assertEqual ( group . id , self . id ) <EOL> self . assertTrue ( group ) <EOL> def test_get_by_id ( self ) : <EOL> group = ops . group ( id = self . id ) <EOL> self . assertEqual ( group . name , self . name ) <EOL> self . assertTrue ( group ) <EOL> def test_get_by_invalid_id ( self ) : <EOL> group = ops . group ( id = - <NUM_LIT:1> ) <EOL> self . assertTrue ( group . id is None ) <EOL> self . assertTrue ( group . name is None ) <EOL> self . assertFalse ( group ) <EOL> def test_get_by_name ( self ) : <EOL> group = ops . group ( name = self . name ) <EOL> self . assertEqual ( group . id , self . id ) <EOL> self . assertTrue ( group ) <EOL> def test_get_by_invalid_name ( self ) : <EOL> group = ops . group ( name = helper . uuid ( ) ) <EOL> self . assertTrue ( group . id is None ) <EOL> self . assertTrue ( group . name is None ) <EOL> self . assertFalse ( group ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
