<s> import unittest2 <EOL> class TestConnection ( unittest2 . TestCase ) : <EOL> def _getTargetClass ( self ) : <EOL> from gcloud . monitoring . connection import Connection <EOL> return Connection <EOL> def _makeOne ( self , * args , ** kwargs ) : <EOL> return self . _getTargetClass ( ) ( * args , ** kwargs ) <EOL> def test_constructor ( self ) : <EOL> credentials = _Credentials ( ) <EOL> connection = self . _makeOne ( credentials ) <EOL> self . assertEqual ( connection . credentials . _scopes , <EOL> self . _getTargetClass ( ) . SCOPE ) <EOL> class _Credentials ( object ) : <EOL> _scopes = None <EOL> @ staticmethod <EOL> def create_scoped_required ( ) : <EOL> return True <EOL> def create_scoped ( self , scope ) : <EOL> self . _scopes = scope <EOL> return self </s>
