@@ -77,7 +77,6 @@ var fakePaginator = {
7777 'getMachineTypes' ,
7878 'getNetworks' ,
7979 'getOperations' ,
80- 'getProject' ,
8180 'getRegions' ,
8281 'getRules' ,
8382 'getServices' ,
@@ -230,7 +229,6 @@ describe('Compute', function() {
230229 assert . strictEqual ( compute . getMachineTypesStream , 'getMachineTypes' ) ;
231230 assert . strictEqual ( compute . getNetworksStream , 'getNetworks' ) ;
232231 assert . strictEqual ( compute . getOperationsStream , 'getOperations' ) ;
233- assert . strictEqual ( compute . getProjectStream , 'getProject' ) ;
234232 assert . strictEqual ( compute . getRegionsStream , 'getRegions' ) ;
235233 assert . strictEqual ( compute . getRulesStream , 'getRules' ) ;
236234 assert . strictEqual ( compute . getServicesStream , 'getServices' ) ;
@@ -1816,99 +1814,6 @@ describe('Compute', function() {
18161814 } ) ;
18171815 } ) ;
18181816
1819- describe ( 'getProject' , function ( ) {
1820- it ( 'should accept only a callback' , function ( done ) {
1821- compute . request = function ( reqOpts ) {
1822- assert . deepEqual ( reqOpts . qs , { } ) ;
1823- done ( ) ;
1824- } ;
1825-
1826- compute . getProject ( assert . ifError ) ;
1827- } ) ;
1828-
1829- it ( 'should make the correct API request' , function ( done ) {
1830- var options = { } ;
1831-
1832- compute . request = function ( reqOpts ) {
1833- assert . strictEqual ( reqOpts . uri , '' ) ;
1834- assert . strictEqual ( reqOpts . qs , options ) ;
1835- done ( ) ;
1836- } ;
1837-
1838- compute . getProject ( options , assert . ifError ) ;
1839- } ) ;
1840-
1841- describe ( 'error' , function ( ) {
1842- var error = new Error ( 'Error.' ) ;
1843- var apiResponse = { a : 'b' , c : 'd' } ;
1844-
1845- beforeEach ( function ( ) {
1846- compute . request = function ( reqOpts , callback ) {
1847- callback ( error , apiResponse ) ;
1848- } ;
1849- } ) ;
1850-
1851- it ( 'should execute callback with error & API response' , function ( done ) {
1852- compute . getProject ( { } , function ( err , project , nextQuery , resp ) {
1853- assert . strictEqual ( err , error ) ;
1854- assert . strictEqual ( project , null ) ;
1855- assert . strictEqual ( nextQuery , null ) ;
1856- assert . strictEqual ( resp , apiResponse ) ;
1857-
1858- done ( ) ;
1859- } ) ;
1860- } ) ;
1861- } ) ;
1862-
1863- describe ( 'success' , function ( ) {
1864- var project = { name : PROJECT_ID } ;
1865- var apiResponse = project ;
1866-
1867- beforeEach ( function ( ) {
1868- compute . request = function ( reqOpts , callback ) {
1869- callback ( null , apiResponse ) ;
1870- } ;
1871- } ) ;
1872-
1873- it ( 'should create Project object from the response' , function ( done ) {
1874- compute . project = function ( name ) {
1875- assert . strictEqual ( name , project . name ) ;
1876- setImmediate ( done ) ;
1877- return project ;
1878- } ;
1879-
1880- compute . getProject ( { } , ( err ) => {
1881- assert . ifError ( err ) ;
1882-
1883- compute . project ( PROJECT_ID ) ;
1884- } ) ;
1885- } ) ;
1886-
1887- it ( 'shouldn\'t build a nextQuery' , function ( done ) {
1888- var apiResponseWithNextPageToken = extend ( { } , apiResponse , {
1889- nextPageToken : 'next-page-token'
1890- } ) ;
1891-
1892- var query = { a : 'b' , c : 'd' } ;
1893- var originalQuery = extend ( { } , query ) ;
1894-
1895- compute . request = function ( reqOpts , callback ) {
1896- callback ( null , apiResponseWithNextPageToken ) ;
1897- } ;
1898-
1899- compute . getProject ( query , function ( err , project , nextQuery ) {
1900- assert . ifError ( err ) ;
1901-
1902- assert . deepEqual ( query , originalQuery ) ;
1903-
1904- assert . strictEqual ( nextQuery , null ) ;
1905-
1906- done ( ) ;
1907- } ) ;
1908- } ) ;
1909- } ) ;
1910- } ) ;
1911-
19121817 describe ( 'getRegions' , function ( ) {
19131818 it ( 'should work with only a callback' , function ( done ) {
19141819 compute . request = function ( reqOpts ) {
@@ -2646,6 +2551,14 @@ describe('Compute', function() {
26462551 } ) ;
26472552 } ) ;
26482553
2554+ describe ( 'project' , function ( ) {
2555+ it ( 'should return a Region object' , function ( ) {
2556+ var project = compute . project ( ) ;
2557+ assert ( project instanceof FakeProject ) ;
2558+ assert . strictEqual ( project . calledWith_ [ 0 ] , compute ) ;
2559+ } ) ;
2560+ } ) ;
2561+
26492562 describe ( 'region' , function ( ) {
26502563 var NAME = 'region-name' ;
26512564
0 commit comments